PDA

View Full Version : UTF8 encoding/translating text.


matt poole
02-24-2003, 01:06 PM
Im building a presentation that will be translated into a number of languages (inc Asian).

The translation company would like the text in a text file being loaded into dynamic text fields. I've done all this. The user selects the language at the start and I use the TextFormat object to set the text field to use the correct font.

I sent a test sentence off just to make sure it would work ok (see attached). It didnt. I did a search on the site to look for help and found that setting variables to UTF8 format helps with different characters. Is this what I need? how do I set UTF8 encoding?

Can you have a look at the attached fla. It includes the .fla, a text file with a variable translated into japanese and an image of what is curretly happening on the translators machine. It Uses 'MS ui Gothic' for japanese.

Am I approaching this in the right way, taking into account that the client wants the end user to select which language they want to view the presentaion in?

Billy T
02-24-2003, 01:55 PM
the text file wasn't in japanese for me

matt poole
02-24-2003, 02:03 PM
nor me, but I assumed that was because I didnt have the font.

what did it look like?

Billy T
02-24-2003, 02:07 PM
english text

I did a site like this recently

I put all the text into utf8 xml files - a node for each language

I got someone who could view the translated text correctly to save it from word as a utf8 txt file and then I could just copy and paste the asian characters into the xml file

cheers

matt poole
02-24-2003, 02:13 PM
would this work with text files?

matt poole
02-24-2003, 02:21 PM
btw this is for a CD ROM presentation, ultimately they want it all to be just one executable. ie no external files. I thought I'd cut and paste the translated texts and put each language into a movieclip and attach that appropriate clip when the language is selected. Then refer to the text variables from a path relating to the atttached clip.

Billy T
02-24-2003, 03:03 PM
yeah it should work fine with txt files

not sure if copy/pasting the text in to flash will work though

cheers

matt poole
02-24-2003, 03:08 PM
thanks for your help Billy, one more question:

how do you save as an UFT8 txt file?

Billy T
02-24-2003, 03:24 PM
from word? choose save as and then under format choose "unicode text"

other apps may work differently. In dreamweaver you go to page properties I think

cheers

matt poole
02-24-2003, 04:25 PM
It works!!

Cheers Billy. the text files were saved as UTF8, but when you save them in word it adds 3 extra bytes of X'EFBBBF'. It must be this that makes it work.

thanks for your help.

Billy T
02-24-2003, 10:31 PM
no worries

there's a pretty detailed tute for this at macromedia.com - think its called flash localization

cheers

matt poole
02-25-2003, 08:47 PM
Yeah I found a link to it on this site already. Apparently you can use:

System.codepage = true

...for text that is not Unicode encoded, it makes the flash player use the host systems codepage.

Billy T
02-25-2003, 08:49 PM
but the tute recommended that you don't use that method didn't it?

matt poole
02-25-2003, 08:54 PM
Cant remember off hand. It did say using it more than once in a movie can yield unexpected results.

I think you're right that its probably better just using a text editor to save for Unicode.