Problems with greek text

Discuss any general programming issues here
Post Reply
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Problems with greek text

Post by g0blin »

Hello everyone,

I'm here trying to include a greek text inside my software, withouth success.
I've searched the forums here to find a solution, and as far as I understand there is not much that I can do at the moment.

All I'm trying to do is to grab a string like the following "Το έμβλημα της αστυνομίας της Middle City.", pass it to "CreateTextObject" instruction and then display it on screen. According to "Notepad++", the file containing all the strings is a standard ISO 8859-7 greek text file. Reading the forums (and the manual) this format is not yet included in Hollywood (it only displays very garbled text), so I tried different roads:

- converted it into ANSI: nothing
- converted it into UTF-8 (with AND without BOM): nothing
- converted into ISO 8859-1: nothing (obviously).

Since one of the forums suggested to leave the script as it is and send it to the greek tester (which, of course, has greek prefs in his machine), I also compiled a test version for him: nothing.

What else can I try to do? :?: :(

Best regards
g0blin
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problems with greek text

Post by airsoftsoftwair »

You need to set the "Encoding" tag to UTF8, i.e.

Code: Select all

CreateTextObject(1, "....", {Encoding = #ENCODING_UTF8})
Also make sure that the font you're using supports Greek characters.
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Problems with greek text

Post by g0blin »

I tried yesterday night, without success.

The text is nicely showing inside "Notepad++", using ISO 8859-7 and UTF8 encoding. Nonetheless, Hollywood IDE (windows) shows only garbage, and the running code is even worse.

I'm using Hollywood in-build font engine and font style is set on "Serif Bold".

I'll try again tonight with different fonts and I'll report back.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problems with greek text

Post by airsoftsoftwair »

Don't paste non ISO 8859-1 into the Windows IDE because it is not designed to handle this. The best approach is to store all non-Latin text in external, UTF-8 encoded files (but without the BOM). Then import the language strings from these external files and pass them to CreateTextObject(). AFAIR the inbuilt fonts don't support Greek characters. You need to use a different font for this, e.g. one from the DejaVu series. These are more complete.
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Re: Problems with greek text

Post by p-OS »

I'm also interested in this topic (UTF8 Text).
What does BOM mean in this context ?
And which Editor could I use for writing external Text files containing UTF8 Text on MorphOS ?
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Problems with greek text

Post by g0blin »

Thanks Andreas, I'll work on in on the weekend and let you know.

@p-OS
I'm not very into it myself, so check this extract from Wikipedia:

"The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. It is encoded at U+FEFF byte order mark (BOM). BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in."
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problems with greek text

Post by airsoftsoftwair »

p-OS wrote:I'm also interested in this topic (UTF8 Text).
What does BOM mean in this context ?
Most UTF8-capable text editors will write the BOM at the beginning of the text file to indicate that the text file uses UTF-8 encoding. This BOM consists of the following three bytes: $EF $BB $BF. In ISO8859-1 these bytes are shown as  but UTF-8 capable viewers of course won't show them.
And which Editor could I use for writing external Text files containing UTF8 Text on MorphOS ?
Scribble supports UTF-8 text.
Post Reply