Thursday, 7 June 2007

Flex: ISO-8859-1 vs. UTF-8

Hint:
In a flex/flash project we encoded our files using iso-8859-1 encoding resulting in the danish characters like æ, ø etc. not being encoded correct.

The adobe flex compiler seems to interpret all files not containing a Byte Order Mark (BOM) as utf-8 even though we specified the -compiler.actionscript-file-encoding option.
Changing our files to utf-8 encoding solved the problem and no -compiler.actionscript-file-encoding option was needed.

And luckily for that as the israfil maven flex plugin that we use doesn't support the -compiler.actionscript-file-encoding option in the latest available version (1.0).

1 comment:

Anonymous said...

From our QA team:

If users use Danish characters in mxml file then the encoding needs to be specified in the xml declaration. The compiler argument is only for action script files.

If I compile the code below with -compiler.actionscript-file-encoding=ISO-8859-1. I get to see the proper character, but not the correct one if don’t specify the encoding.

Mike
http://www.flex.org/