where CsZ is a cstring and m_ZPosVal is the CStatic derived class, and the text string ("") is the the position in microns of a pointer.
Unfortunately, the micron symbol is converted to kanji (or similar) on Japanese Windows.
My very simple task is to embed or force the "µ" symbol to remain as-is despite language settings.
Our application is built with _MBCS defined - so that SHOULD handle single and double characters in a text string (as I understand). However, I can find no way to force this case. I have tried things like:
83 be | α β γ δ ε ζ η θ ι κ λ μ ν ξ ο 83 ce | π ρ σ τ υ φ χ ψ ω
Shift-JIS defines Greek characters around here. (0xB5 is the Unicode code point.)
Of course what you really want is Microsoft Code Page 932 reference. In case MS did something different ;)
Anyway what you want to know is this. To make it all independent of the actual Windows language (or locale rather), you could define a Unicode string with Unicode μ (0x00B5) and at runtime use wcstombs to get the correct character for the language that is in effect. (At a guess).
(Strangely enough B5 is short for Big5, Chinese code page...)
Actually, if the users don't actually need Japanese for your app, you can force the application to think it's running on a European/US version of Windows without affection other applications.
Under Windows XP I used Applocale (free from MS). Unfortunately this isn't officially available for Vista/Se7en.
Thanks for the reply & sorry for the delay. I'll try your suggestions and report back my findings. As work's gone silly at the moment - this may be a while ;-)
Seriously though, thanks for your input! Much appreciated!!!!! :-D
#include <iostream>
#include<stdlib.h>
usingnamespace std;
int main()
{
char sz[20];
// Unicode for mu
wchar_t wsz[20] = L"\x00b5";
// Set Japanese code page
// May not be necessary for MBCS Windows GUI program
setlocale(LC_ALL, ".932");
int i = wcstombs(sz, wsz, 20);
cout << i << endl;
cout << hex << int(sz[0]) << endl;
cout << hex << int(sz[1]) << endl;
}