I tried to read the string documentation and I am quite lost.
http://www.mozilla.org/projects/xpcom/string-guide.html
and mostly
http://lxr.mozilla.org/mozilla/source/xpcom/string/public/nsStringAPI.h
I have a javascript program that read HTML. Sometimes, the HTML
contains some non-ascii character. Then I call a C function with
the string.
I was using the "string" IDL type before and I was loosing non-ascii
character. But finally, my program was working fine.
My program understand UTF8 so, I tried several things :-)
But mostly this.
I have defined a IDL function like this:
interface nsIFoo : nsISupports {
myFunction(in AUTF8String mystring);
};
There is a C++ function generated that got that signature
NS_IMETHOD MyFunction(const nsACString& mystring)
Then there I try to get a (char *) pointing to the data.
I tried a lot of things like wstring. But without success.
For example this
const char * data;
NS_CStringGetData(mystring, &data); -> core dump ?
I tried with wstring where the result was quite stranger.
For a string "abc", I got a PRUnichar * that contains
0x6261 0x0063 like it is was still in ascii or utf8 ?
Any idea or pointer to something that works
will be appreciated :-)
Thanks by advance,
Marc
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom