|
Boost : |
From: Adrian Michel (michel_at_[hidden])
Date: 2003-09-14 19:17:45
>
> wchar * != unicode.
>
> Just using wchar_t is by far not enough to expect unicode support.
> You generally need to know what encoding a string is in. In particular,
> some encodings such as utf-8 don't even have a fixed-width representation.
>
> You really need a unicode library to deal with these issues. A
> unicode-enabled
> path manipulation library would have to depend on it. Of course, one could
> provide a templates based interface, where you plug in the unicode support
> in terms of string and trait type parameters.
>
I did not mention that I was referring to Unicode on Windows, which uses 16
bits characters.
There is support for data streams of Unicode characters. For example, in
boost/filesystem/fstream.hpp:
...
typedef basic_fstream<char> fstream;
typedef basic_fstream<wchar_t> wfstream
...
The class path has the following constructors
path();
path( const std::string & src );
path( const char * src );
path( const std::string & src, path_format );
path( const char * src, path_format );
none of which takes 16 bit Unicode characters. Creating a template version
of path with the character type as parameter may be a solution to this
problem.
I am currently using MS VC++ 6 and their implementation of std::fstream also
lacks Unicode support for file names. I am not sure about .net though.
Adrian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk