Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi My C++ code load a Russian string from resource file but it displays as question mark (????)

str;
str.LoadString(REQSETTINGS);

How can I get the string with Russians text?
Thanks for any help
Posted
Updated 1-Apr-14 4:53am
v2
Comments
Steve44 1-Apr-14 12:14pm    
Some more details are necessary to help you with this. What type is the string: ASCII or Unicode? If it is ASCII, have you selected the appropriate codepage? Does your font contain the Cyrillic letters for rendering? Did you look at str in the debugger? Does it contain the expected characters?
More details are always helpful as we don't see your development environment.
Thanks!
merh 2-Apr-14 4:49am    
I found the problem in "Regional and language Options" under Standards and Formats. I has to be changed to Russian and the question marks are removed. The string loads correctly the string from the resorce file but when the string is added to the tab, it shows strange characters which are not Russians.
str.LoadString(REQSETTINGS);
nTab = m_tabWnd.AddViewTab(RUNTIME_CLASS(CRequiredSettingsView), str, pContext);
m_ptrRequiredSettingsView = (CRequiredSettingsView*) m_tabWnd.GetTabClient(nTab);
m_tabWnd.SetTabIcon(nTab, IDI_Page);
m_ptrRequiredSettingsView->SetFileControler(m_pFileControler);

Thanks for any Help
merh

This is probably because you are not using UNICODE. See following link:
http://msdn.microsoft.com/en-us/library/dybsewaf.aspx[^]
 
Share this answer
 
By changeing the font.
CFont font;
setlocale(LC_ALL, "Russian");
font.CreateFont(-11, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Tahoma");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900