How to Get chinese text from rtf in messagebox .
-
Hi In my system not installed languagepack.when i paste chinese characters in rtf .. In sending i wrote this code... m_chattext.GetWindowText(m_Text); AfxMessageBox(m_Text); here m_chattext is rtf object. in messagebox the chinese characters are not displaying..its coming ???? how i can solve this problem ...plz tell...
#sanroop#
-
Hi In my system not installed languagepack.when i paste chinese characters in rtf .. In sending i wrote this code... m_chattext.GetWindowText(m_Text); AfxMessageBox(m_Text); here m_chattext is rtf object. in messagebox the chinese characters are not displaying..its coming ???? how i can solve this problem ...plz tell...
#sanroop#
There is no one thing, hence your difficulty in getting this question answered. Do you understand about Unicode I wonder? You need to compile your application with UNICODE and _UNICODE defined so that AfxMessageBox maps to AfxMessageBoxW, which is capable of displaying Chinese characters if and only if the default system font that it uses, (depends on XP or Vista etc) contains those characters. Then you need to make sure that you are using wide character variables (wchar_t, TCHAR if UNICODE is defined) to both get the data form the clipboard and pass it to the message box so that you don't loose data along the way. That's if the clipboard is giving you wide character data in the first place. You might have to request a different format, or do conversion from a specific Chinese code page. Do you know about Code pages? You can see that there is rather a lot going on here already and this may not be the end of the story as you're involving RTF as well. To get a more definitive answer you'll need to give better information on what you already understand and what you're actually doing, a few lines of code would be good, and be prepared to ask a series of smaller questions to get all the info you need.
Nothing is exactly what it seems but everything with seems can be unpicked.
-
There is no one thing, hence your difficulty in getting this question answered. Do you understand about Unicode I wonder? You need to compile your application with UNICODE and _UNICODE defined so that AfxMessageBox maps to AfxMessageBoxW, which is capable of displaying Chinese characters if and only if the default system font that it uses, (depends on XP or Vista etc) contains those characters. Then you need to make sure that you are using wide character variables (wchar_t, TCHAR if UNICODE is defined) to both get the data form the clipboard and pass it to the message box so that you don't loose data along the way. That's if the clipboard is giving you wide character data in the first place. You might have to request a different format, or do conversion from a specific Chinese code page. Do you know about Code pages? You can see that there is rather a lot going on here already and this may not be the end of the story as you're involving RTF as well. To get a more definitive answer you'll need to give better information on what you already understand and what you're actually doing, a few lines of code would be good, and be prepared to ask a series of smaller questions to get all the info you need.
Nothing is exactly what it seems but everything with seems can be unpicked.
A non-Unicode program can display Chinese text in MBCS way. But two premises are required:
1. The system should be Chinese character set installed (for viewing with IE and other text applications).
2. The text buffer to output or to input in the source code should not contain a second character set (for example a mix of Chinese and Japanese). Otherwise when you are about to save the .cpp file to compile, VC++ prompts and forces you to save the file in Unicode.
Maxwell Chen
-
There is no one thing, hence your difficulty in getting this question answered. Do you understand about Unicode I wonder? You need to compile your application with UNICODE and _UNICODE defined so that AfxMessageBox maps to AfxMessageBoxW, which is capable of displaying Chinese characters if and only if the default system font that it uses, (depends on XP or Vista etc) contains those characters. Then you need to make sure that you are using wide character variables (wchar_t, TCHAR if UNICODE is defined) to both get the data form the clipboard and pass it to the message box so that you don't loose data along the way. That's if the clipboard is giving you wide character data in the first place. You might have to request a different format, or do conversion from a specific Chinese code page. Do you know about Code pages? You can see that there is rather a lot going on here already and this may not be the end of the story as you're involving RTF as well. To get a more definitive answer you'll need to give better information on what you already understand and what you're actually doing, a few lines of code would be good, and be prepared to ask a series of smaller questions to get all the info you need.
Nothing is exactly what it seems but everything with seems can be unpicked.
A non-Unicode program can display Chinese text in MBCS way. But two premises are required: 1. The system should be Chinese character set installed (for viewing with IE and other text applications). 2. The text buffer to output or to input in the source code should not contain a second character set (for example a mix of Chinese and Japanese). Otherwise when you are about to save the .cpp file to compile, VC++ prompts and forces you to save the file in Unicode.
Maxwell Chen
-
A non-Unicode program can display Chinese text in MBCS way. But two premises are required:
1. The system should be Chinese character set installed (for viewing with IE and other text applications).
2. The text buffer to output or to input in the source code should not contain a second character set (for example a mix of Chinese and Japanese). Otherwise when you are about to save the .cpp file to compile, VC++ prompts and forces you to save the file in Unicode.
Maxwell Chen
Indeed but I think in this case 1. is scuppered by the lack of a language pack and 2. can't be gaurenteed because the data is external input form the clipboard. It could contain anything. Also MBCS is a minefield if you don't already understand Unicode and Code Pages. It's pretty treacherous even if you do :)
Nothing is exactly what it seems but everything with seems can be unpicked.
-
A non-Unicode program can display Chinese text in MBCS way. But two premises are required:
1. The system should be Chinese character set installed (for viewing with IE and other text applications).
2. The text buffer to output or to input in the source code should not contain a second character set (for example a mix of Chinese and Japanese). Otherwise when you are about to save the .cpp file to compile, VC++ prompts and forces you to save the file in Unicode.
Maxwell Chen
The lines last far too long, but the horizontal scroll bar does not show up. I can not reach the "Edit" button to modify the post.
Maxwell Chen