Normally this is not a problem, but when it encounters a Chinese application
name, it displays the name as question marks. I assume this is because the
string is in Unicode in the registry, but our app is not Unicode so it can't
represent the characters.
Unfortunately for the moment, converting this very large app to Unicode is
not an option.
How can we (or can we at all?) convert these "????" strings to their actual
Chinese characters?
We have the Chinese character support added via the control panel's Regional
Settings, so we can see the Chinese chars correctly when we view them in
RegEdit, etc., even though our current regional settings are for US.
(changing the regional settings via the control panel to Chinese is not an
option). It's just our app that returns the ????? chars.
We've tried explicitly calling RegQueryValueExW to read the value, but it
still comes back to us as '????'.
Is it possible to read a unicode string from the registry from a non-unicode
application?
Any help would be greatly appreciated!
Thanks!
>...
> We've tried explicitly calling RegQueryValueExW to read the value, but it
> still comes back to us as '????'.
Using WCHAR (wchar_t) explicitly and calling the ...W() versions of API
functions should work if you do it consistently. (You also have to make
sure that when you look at it, you are using a font which has all the
relevant unicode characters.)
Do the Watch Windows in VS2005 display wchar_t strings including Chinese
characters? I believe they do - certainly I can see the musical flat
symbol which is somewhere on another planet in the unicode set. (I don't
know for sure, but I'll bet this doesn't work in Visual Studio 6.)
> Is it possible to read a unicode string from the registry from a
> non-unicode application?
Because of the history of my application I am using a mixture of CHAR,
WCHAR and (as much as possible) TCHAR with the appropriate routines to
handle each. It now works when compiled with and without the UNICODE flag.
I have always used the standard registry functions with TCHAR but everything
else has worked fine and so I have no doubt that the registry functions will
work too if you do it consistently.
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
When you call WideCharToMultiByte you can specify what code page to use.
You can convert them to Chinese ANSI strings. But if you display these in a
window that uses a US-English code page, the results will look like garbage.
If you don't use Unicode, you'll have to make sure that all parts of your
application are on the same code page.
"Mark Findlay" <mfin...@speakeasy.org> wrote in message
news:R_ednclhybk8Pzjb...@speakeasy.net...
why not use 'IMultiLanguage' interface (comes with IE 4), with functions
'ConvertStringFromUnicode' and 'ConvertStringToUnicode'.
With this interface, you are independant from the current process local ...
Rolf
"Mark Findlay" <mfin...@speakeasy.org> schrieb im Newsbeitrag
news:R_ednclhybk8Pzjb...@speakeasy.net...