Page 1 of 1

JavaScript and UTF-8

Posted: Wed Jun 22, 2011 9:16 am
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)

JavaScript and UTF-8

Posted: Wed Jun 22, 2011 10:04 am
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.

JavaScript and UTF-8

Posted: Wed Jun 22, 2011 10:12 am
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

JavaScript and UTF-8

Posted: Mon Jun 27, 2011 2:50 pm
by Kai
FYI this has now been fixed, though you'll need to contact tech support for an upgrade.