Issues with certain Unicode Characters

Working on a French Flash activity, I had problems displaying certain French characters:

    OE Upper Case ligature  Unicode 0152  
    oe Lower Case ligature Unicode  0153
    Ÿ  Upper Case diaeresis Unicode  0178  

With a normal (8-bit) font these characters cannot be displayed, so I created a Method in a Class StringUtilities to replace these characters with alternatives.


 —
 public static function replaceFrenchLigatureCharacters(text : String) : String {
            var len : Number = text.length;
            var returnText : String = “”;
             for (var i : Number = 0;i < len; i++) {
                var char : String = text.charAt(i);
                var code : Number = text.charCodeAt(i);
                switch(code) {   
                    case O_E_SMALL_LIGATURE  :
                        returnText += “oe”;
                        break;
                   
                    case O_E_UPPER_LIGATURE :
                        returnText += “OE”    ;
                        break;
                       
                    case Y_UPPER_DIAERESIS :
                        returnText += “Y”;
                        break;
                    default :
                        returnText += char;
                }
            }
            return returnText;

        }
 —
 —

This is going to be an issue for all non standard characters which belong to the Extended-A_Unicode_block rather than the standard Basic Latin (00 to 7F) and the Latin-1 Supplement (80 to FF) . So I’m sure this issue will raise it’s head again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s