Subj : Re: SpiderMonkey: JS_InitStandardClasses allways fails To : =?ISO-8859-1?Q?Georg_Maa=DF?= From : Brendan Eich Date : Thu May 15 2003 10:32 am Georg Maaß wrote: > Brendan Eich wrote: > >> What character set encoding does "most system stuff" expect to be in >> a char array passed via a char * formal parameter? ASCII? >> ISO-Latin-1? A multi-byte encoding? > > > The encoding defined by the C locale which is the only locale with > known name which is guaranteed to be allways present. No other locale > is used, because neither their names are known, because there is no > naming standard nor their presence is guaranteed. Trying to uses them > requires a dialog to present them and select one. But HTTP is not a > "dialog protocol" but a "hit me to make my cry protocol". On a server > application that handles HTTP request, this would require configuring > the locales by the administrator. This is only useful is the > administrator of the server side application is root, because root > manages the locales. > > I don't want my application to depend on users being root. Whoever said anything about that? You clearly need character set transcoding. Maybe iconv(3), or uconv from mozilla/intl. Don't just assume you can chop jschar to char, or try to get away with it if the high bytes are all zero. If your locale (or the HTTP charset) uses a multibyte encoding stored in char[], then inflating char to jschar will mangle strings, in general. /be > > .