|
From: Ioannis V. <no...@ho...> - 2003-02-17 22:36:57
|
-------Original Message-------=0D =0D From: Torsten Curdt=0D Date: =C4=E5=F5=F4=DD=F1=E1, 17 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 4:= 42:55 =EC=EC=0D To: dev...@li...=0D Subject: [Dev-C++] unicode=0D =0D I just switched my application to unicode by specifying the=0D "-D UNICODE" and "-D _UNICODE" compiler options.=0D =0D But the STL string class refused to accept that. Though=0D it uses the "charT" type.=0D =0D Any pointers how to switch it to unicode?=0D =0D =0D =3D=3D> Try using wchar_t *built in* type which is also portable. And for= string use basic_string<wchar_t>.=0D =0D For example:=0D =0D // L in front converts a regular string to wchar_t.=0D basic_string<wchar_t> s=3DL"Something";=0D =0D =0D The string type is nothing else than:=0D =0D typedef basic_string<char> string;=0D =0D =0D For wide character sets, wchar_t is your type and where UNICODE is suppor= ted it usually is UNICODE.=0D =0D =0D Unfortunately (& strangely) i have the impression that MINGW does not provide wcout, so in this case you will have to use the C-subset wprintf(= ) in the style:=0D =0D wprintf(L"%s\n", s);=0D =0D =0D Try being as much portable as possible. In this way you will have fewer incompatibilities with other compilers or even next releases of your compiler.=0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |