Menu

#1 Multi-Byte characters getting mangled.

open-wont-fix
nobody
None
5
2007-03-04
2007-02-28
Anonymous
No

Today, I noticed mangled text on my page. It turns out that I used multibyte characters in strings in my UTF-8 encoded Javascript files, and they were not preserved by jscompact.

"übertragen" was changed to "\xC3\xBCbertragen". I changed "übertragen" to "\u00FCbertragen" and everything was fine. But I would rather not do this for maintenance reasons.

Discussion

  • Dan Libby

    Dan Libby - 2007-03-04

    Logged In: YES
    user_id=49025
    Originator: NO

    Spidermonkey does not seem to offer any way to control this escaping behavior for utf-8 encoded strings.

    It should be noted though that the escaped strings it emits are correct. If you run the string "\xC3\xBCbertragen" through the js interpreter in a print statement, it will print "übertragen" as desired.

    Marking wont't fix, as spidermonkey doesn't offer control over this, and the generated scripts do produce correct output when run.

     
  • Dan Libby

    Dan Libby - 2007-03-04
    • status: open --> open-wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB