I'm loading a HTML page with my Javascript function defined in a <script> area. What are the ways the file can be compiled, and is there a way for me to check this?
The thing that confuses me is why most of the values are correct in UTF8. 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. Thanks. On May 27, 11:30 am, Boris Zbarsky <[EMAIL PROTECTED]> wrote: > Richard Young wrote: > > I'm not sure how the JS file was compiled, but it's saved in ANSI > > format. > > The point is, depending on how the JS file is compiled the bytes in that file > will be interepreted differently to produce the JSString. So how it's > compiled > is very important, given that you have raw non-ASCII bytes in the source. > > > I am actually embedding a web browser in an application, and invoking > > JS functions through the JS API. > > But the browser is what loaded the JS file, right? > > > I also notice that JS_C_STRINGS_ARE_UTF8 is false, would that be > > causing my issue? > > That define controls how char* is treated by the JS engine. Unless you're > using > the non-Unicode JSAPI functions, it shouldn't be affecting you. > > -Boris _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
