The HTML page is encoded in plain ANSI.
I've also moved my Javascript function in an external file, and tried
both ANSI and UTF8 encodings, and it still returns the same incorrect
values.

I'm not sure how the engine works in the background, maybe some JS
string functions are screwing up the UTF8 when the code is being
evaluated.

Does anybody have any experiences with UTF8 strings and using the JS
engine?

Thanks.

On May 27, 12:22 pm, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> Richard Young wrote:
> > I'm loading a HTML page with my Javascript function defined in a
> > <script> area.
>
> If it's an inline script (i.e. not pointed to by the src attribute), the bytes
> will be treated as being in the encoding of the HTML page and converted to 
> UCS-2
> before being passed to the JS engine.
>
> What's the encoding of the HTML page?
>
> > Calling JS_GetStringBytes to get the bytes from my JSString* doesn't
> > work either since it seems to simply cast each UINT16 to a CHAR, and I
> > get the same results.
>
> Right, since you're using the browser, which does ISO-8859-1 char* stuff in 
> JS.
>
> -Boris

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to