Overview
Features
Download
Documentation
Community
Add-Ons & Services

Re: MSVS80 Unicode

Please post support and help requests here.

Re: MSVS80 Unicode

Postby guenter » 06 Dec 2006, 17:11

Welcome aboard!

Building the XML library with XML_UNICODE and XML_UNICODE_WCHAR_T will make it unusable for the rest of POCO, most notably the Util library.
Internally, POCO uses std::string for all strings. Regarding Unicode, the convention is to store UTF-8 in std::string, and that's about it. For cross-platform applications, std::wstring is just too troublesome to be useful (wchar_t is 16 bit UTF-16 on Windows and 32-bit on Unix platforms...), so we don't use it.

Note that the XML library will give you UTF-8 in a std::string as well, so there's no need to build it with XML_UNICODE/XML_UNICODE_WCHAR_T.

Now what does POCO_WIN32_UTF8 do? Basically, it builds POCO in such a way that POCO calls the Unicode variants of all Windows API functions. It expects all std::strings to contain valid UTF-8 characters and converts them to UTF-16 before passing them to a Windows function (and the reverse for results).

Note that all modern Unix platforms support UTF-8 as well, so this seems to be the best compromise for now.

And coming up with our own string class? Well, aren't there are enough string classes out there already? And for std::wstring - it's only Unicode on Windows, so no really useful in a cross-platform scenario.

Best regards,

Günter

> Hello,
>
> I'm rather new to Poco while quite impressed by the functionality provided by the labrary. I have some experience in usage of cross-platform c++ layers serving for different needs and Poco seems to be really nice, combining many features just together.
>
> What concerns the problem:
> I've successfully built Poco with msvs80 without any errors. Even with no warnings at all. The problems came up when I decided to compile it with UNICODE support.
> For that I declared 3 macro in the config.h:
> POCO_WIN32_UTF8, XML_UNICODE and XML_UNICODE_WCHAR_T
> As a result I received many errors in test projects and what is the worst, the "util" library failed to build at all.
> Moreover, somewhere I read about Poco's comprehensive support for Unicode in the XML library but that is also not so true, as for example I simply cannot use a Unicode string as a source for XML data (only constructor for std::string is provided).
>
> My questions are:
> does anybody have Unicode experience with Poco and what results do you have? Maybe I'm just missing something obvious, that results in the problems above.
> Also it is interesting to know whether Poco development team has plans to improve Unicode support of the library and to which extent?
> My personal opinion is that it may be really helpful to get rid of all direct std::(w)string references and just make use of some Poco string class based on std library while being correctly defined for both Unicode and non-Unicode builds. Does that make sense?
>
> Anyway thanks a lot for Poco, you did a great job, guys.
guenter
 
Posts: 1112
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Re: MSVS80 Unicode

Postby TheRawGod » 06 Dec 2006, 20:21

Thanks a lot for such a fast and descriptive answer!

It really does seem to make sense what you wrote about UTF-8 things, didn't pay enough attention to it myself before:(

Sincerely,
Dmitry.
TheRawGod
 
Posts: 6
Joined: 06 Dec 2006, 13:33
Location: Ukraine


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron