Discussion Locked

Passing multibyte strings in JavaScript

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using JavaScript to support a multilingual website. My pages are created when accessed by loading an html template with language data from a text array.

This works well with single byte pan-european text encodings. However when I attempt this will multi byte shift-jis or jp-euc, I often encounter character corruption when the bytes are shifted. This results in nonsensical or offensive japanese text.

Is there a way to define a double byte character so I can preserve the japanese text when passing it as a string?

Thank you,
John M Wilson

2 replies

by ivan kravchenko

I used UTF-8 and HTML (not JS), that is

instead of just
var msg="...";
in JS file: IE does not support tricky encodings for JS files as it does for HTML.
This approach worked fine for loading Japanese and European text to browser.

HTH

This discussion is closed to new replies.