troubleshooting Question

How to convert a Chinese registry value from within a US code page?

Avatar of rascal
rascalFlag for United States of America asked on
ProgrammingC++System Programming
5 Comments1 Solution791 ViewsLast Modified:
First of all, our Win32 MFC VC++ app is not written in Unicode as it should have been. Given that - it reads uninstall information from the windows Uninstall registry tree and writes it to a report. It writes out the displayname of the application.

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!

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros