SpiderMonkey-How do you make javascript’s string functions to handle multi-byte chars

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rapin
    New Member
    • Oct 2006
    • 1

    SpiderMonkey-How do you make javascript’s string functions to handle multi-byte chars

    How do you make javascript’s string functions (like toUpperCase() or substr()) run under SpiderMonkey to handle multi-byte characters.

    For example:

    var strTest = "ørnen på";
    var strWork = strTest.toUpper Case();
    print( strWork );

    The result is øRNEN På

    It should be ØRNEN PÅ

    Thanks,

    rapin
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Works fine with UTF-8 and ISO-8859-1. Could try unicode or encoding using encodeURICompon ent.

    Comment

    Working...