www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Unicode

↑ ↓ ← "Denis Troshin" <weiv mail.ru> writes:
Hello!

---------------------------
#define UNICODE
#define _UNICODE  
#include <tchar.h> 
#include <wchar.h> 
#include <windows.h>
..
..

WCHAR txt[]=L"Hello";
---------------------------
Compiler generates incorrect unicode-string if I use any characters
with codes > 0x7F
Seems like compiler makes unicode-string just by expanding every byte
of source ansi-string to word. It is ok only for english.
Oct 09 2004
↑ ↓ → "Walter" <newshound digitalmars.com> writes:
"Denis Troshin" <weiv mail.ru> wrote in message
news:ck9mtl$183n$1 digitaldaemon.com...
 Hello!

 ---------------------------
 #define UNICODE
 #define _UNICODE
 #include <tchar.h>
 #include <wchar.h>
 #include <windows.h>
 ..
 ..

 WCHAR txt[]=L"Hello";
 ---------------------------
 Compiler generates incorrect unicode-string if I use any characters
 with codes > 0x7F
 Seems like compiler makes unicode-string just by expanding every byte
 of source ansi-string to word. It is ok only for english.

To embed unicode characters in strings, the only portable way to do it is with \uxxxx.
Oct 10 2004