nsIWebNavigation::LoadURI() wants a UTF16-encoded string for the URI. However, if you call GetSpec() on a URI, it gives you back a UTF8-encoded string. It is not easy to compare these two.
there are functions to convert between UTF-8 and UTF-16... NS_CStringToUTF16.
How are embedders supposed to manage such things? Multi-byte vs. ASCII vs. two-byte in addition to different Unicode encodings.
Anything that's two-byte is UTF-16 in Mozilla. This means all AString and all wstring and all PRUnichar* is in UTF-16.
Many times the documentation for functions/methods are not clear what type of encoding they want the string to be in (though it is clear whether its multi-byte vs. dual-byte b/c of nsAString and nsACString).
Yeah, that kinda sucks. Can you file bugs on functions that don't make it clear which charset a ACString is in?
Am I missing something obvious here? Ideally, I'd be able to create a URI from my text I want to compare, then call nsIURI::Equal(), but I have to pull in way too many header files from mozilla to be able to do that. Am I outside the bounds of the "normal" embedding app?
Hm? Does nsIIOService not suffice to create an nsIURI from an UTF-8 string? _______________________________________________ mozilla-embedding mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-embedding
