JavaScript and UTF-8

Post Reply
amitic
Posts: 14
Joined: Fri Jul 02, 2010 10:57 pm

JavaScript and UTF-8

Post by amitic »

The javascript interpreter in vortex seems to mess up when a multi-byte charset is used for the javascript source.

For example, "'¦'.length" if encoded in ISO-8859-1 returns 1, but if encoded in UTF-8 - returns 2.

Setting the charsetsrc (and even charsettxt) appropriately doesn't help.

If a web server sends UTF-8 encoded JS how do I make that JS run correctly? Converting the JS code to ISO-8859-1 is not an option as the code contains string literals that cannot be represented in 8859-1. Converting to UTF-16 didn't help, either (it actually made things worse - as vortex didn't seem to find the <script> block at all - possibly because of the UTF-16 encoding of the tags).

Any advice?

Texis version: 5.01.1258488718 20091117 (i686-intel-winnt-64-32)
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

JavaScript and UTF-8

Post by Kai »

It probably isn't currently possible for the Vortex JavaScript engine to handle multi-byte charsets correctly; the charset information isn't being set in the JavaScript engine I believe. We're working on a fix for this; contact tech support. Probably a few weeks away, *if* it is possible with the current engine.
amitic
Posts: 14
Joined: Fri Jul 02, 2010 10:57 pm

JavaScript and UTF-8

Post by amitic »

OK. Thanks.
This info was helpful as well. At least I won't waste any time trying to make it work without your fix.

Regards
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

JavaScript and UTF-8

Post by Kai »

FYI this has now been fixed, though you'll need to contact tech support for an upgrade.
Post Reply