Hi,
In my mfc application i am saving some files with file name using UTF-8 characters.
In File menu where it shows recent files, the files having name with utf characters are not shown properly.
it shows ???? instead of those utf -8 characters. I believe the function SetCaption is not setting the captions of files properly.
Or is that i need to change the font for my toolbar? If yes then can anyone tell me the syntax for SetFont function , if i need to set it to "Arial" ?
Thanks,
Ruta
Ruta,
It is important to note that ActiveBar is not designed to fully support unicode, though it is possible to display many unicode characters in ActiveBar. Typically users will set the UseUnicode ActiveBar's property to True to achieve this. If set to True, ActiveBar will use Microsoft's Uniscribe DLLs for Unicode output of strings. This is useful for displaying strings in foreign languages.
Also, when the menuFontStyle property is set to Custom you can use custom font and provide the charset, when its set to system it will use the system settings (regional). In SDI VC++ sample shipped with ActiveBar you can use the following code snippet to achieve this:
m_theBar.SetUseUnicode(true); m_theBar.SetMenuFontStyle(1); COleFont fnt = m_theBar.GetFont(); fnt.SetBold(true); fnt.SetName("Arial"); fnt.SetCharset(...);
Thank you,Andrey T.
I tried your suggestion but still i can not see utf-8 data.
I sent you the screenshot so that u can understand it better.
Also what value should i pass to Setcharset function?
Hi Andrey ,
I can say it work somewhat.
I changed the locale of my system to japanese. And in code currently i hard coded the charset to shiftjis;
Now the question marks are disappeared and some other characters i can see.
Also i am able to click to that filename and my window contains right characters.
See image below. I clicked on the first entry and window appeared with title containig utf8 data.
Do i need to change the font or something to display those characters correctly in the menu? Currently i am using font Arial.
Also what is the mapping between the charsets you have given to me and the values of it? where can i get those values for all the charsets?
I will need to retrieve the system locale and then set that value as charset but then if the charset values given by you are specific to activebar then how can i map system charset to the corresponding activebar charset?
The first entry
These charset values are not specific to ActiveBar. You can find more information about charsets here:http://www.informit.com/articles/article.aspx?p=21307&seqNum=4Also you might need to change a font to display characters correctly. You can find some information in this topic:http://www.microsoft.com/mspress/books/sampchap/2344b.aspxYou can find some information about Japanese fonts and "non-Unicode Programs" settings here:http://www.coscom.co.jp/help3/jpfont/jpfont.html