Re: How to display "8" correctly in German Os or Regional Setting with German?
- From: "Alex Blekhman" <xfkt@xxxxxxxxx>
- Date: Sat, 26 Aug 2006 13:07:53 +0300
<bobbyhsl@xxxxxxxxx> wrote:
I have encountered another question about Unicode char.
See my case1:
Case1:
LPCSTR lpstr = "-=<8";
When I change my regional language form English to German,
the code is
changed to LPCSTR lpstr = "-=<¡Þ". The "8" has been
changed to
wrong characters. The running result of release is also
not correct.
Case2:
CString str(_T("-=<8"));
When I change my regional language form English to German,
the code is
changed to CString str(_T("-=<8"));. The "8" has been
changed to "8".
The running result of release is also not correct.
I just want to display "8" in German environment
correctly. Does any
one know how to solve this problem? Thanks for any
suggestion in
advance.
OK, I found your post in microsoft.public.vc.mfc group. When
you want to post to several groups, don't multipost, but
crosspost. So, all groups will se the same thread.
First of all, if you want to use Unicode character (in this
case: 0x221E, INFINITY), then you need to store it in
appropriate string. You cannot store unicode character in
ANSI string (LPCSTR, as you coded). So, here's the string:
LPCWSTR lpstr = L"-=<\x221E";
or
CStringW str(L"-=<\x221E");
Then, you will need to ensure that the font used for output
is capable of displaying necessary Unicode range. Usually
fonts don't have full Unicode range of characters.
.
- References:
- How to display "8" correctly in German Os or Regional Setting with German?
- From: bobbyhsl@xxxxxxxxx
- How to display "8" correctly in German Os or Regional Setting with German?
- Prev by Date: Re: Migration to C++/CLI
- Next by Date: Re: How to display "8" correctly in German Os or Regional Setting with German?
- Previous by thread: Re: How to display "8" correctly in German Os or Regional Setting with German?
- Next by thread: Is overriding a function of a library in accordance with C++ standard?
- Index(es):
Relevant Pages
|