|
yes but still not sucessfull.
Please tell me what to do
|
|
|
|
|
What not successful? What did you do and what did not happen? If you can't give the details, nobody can help you.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I mean I have used WIN32;NDEBUG;_WINDOWS;_UNICODE preprocessor definitions.
Although i am able to copy type in the notpad the japanese languages characters.
|
|
|
|
|
So, you successfully installed the language packs and are able to type Japanese in notepad!
Now, if your app is STILL displaying question marks when you paste or type Unicode characters, then that means that you have NOT done a Unicode build. I'll guide you to create a small sample project that supports Unicode. Which version of VS are you using?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Did you try creating and setting font to edit box.
I mean create for example Chinese/Japanese font.
Set the font to respective edit box and try typing in or pasting Chinese/Japanese string in it??
I had done something similar for devnagari font.
Regards,
Sandip.
modified on Thursday, September 11, 2008 5:42 AM
|
|
|
|
|
can u just explain me a little bit more what you want to explain.
|
|
|
|
|
i mean create CFont object using Chinese or Japanese font.
Set this font to corresponding edit box and see if you can type or paste chinese/japanese string in that.
Regards,
Sandip.
modified on Thursday, September 11, 2008 5:42 AM
|
|
|
|
|
I have copied japanese text from an english to japanese translator and trying to paste it in the editbox but its how garbage values characters and not the japanese characters in the edit box.
|
|
|
|
|
Do you have japanese fonts installed on your system??
Regards,
Sandip.
modified on Thursday, September 11, 2008 6:45 AM
|
|
|
|
|
yes i have japanese installed on my system
|
|
|
|
|
Did you create the japanese font the changed the default font of the EditBox.
Regards,
Sandip.
|
|
|
|
|
No I havent changed the default font of the edit box
|
|
|
|
|
Try something like this
CFont *pFont = new CFont();
pFont->Create(..)
m_editcontrol.SetFont(pFont);
make sure that you have access to pFont always so you can delete it at the end.
Regards,
Sandip.
|
|
|
|
|
No way. This discussion is deviating way too much in a wrong direction. See here[^]
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
SandipG wrote: I had done something similar for devnagari font.
We are talking about Unicode.
So, if the application is Unicode aware, then I don't think that he will need to set a particular font to the control in order to use it. If the application cannot handle Unicode, setting the font alone can't change the fate of the app. I still bet that his app is Unicode unaware.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Yes since we are talking about UNICODE so there is no need to set the font.
Can you tell me then what exactly is the problem.
|
|
|
|
|
Dhiraj kumar Saini wrote: Yes since we are talking about UNICODE so there is no need to set the font.
Then why were you discussing on that with Sandip, if you knew that already?
Either ways, answer my questions:
1. Have you installed the Unicode languages that you want your app to support on your computer?
2. If yes, have you confirmed that you are able to type and paste those characters into notepad?
3. If yes, are you doing a Unicode build of your app? Yes/No/You don't know? If you don't know, which version of VS are you using?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Well its installed on my system.
Yes I am able to copy and paste the japanese characters in notepad.
Yes I am doing _UNICODE build.
I am using Microsoft Visual STudio.net 2005
Hope i have answered ur questions.
Now what to do.
|
|
|
|
|
What is under the "Preprocessor definitions"? Is the _MBCS property being inherited automatically?
Under the "Linker" node, click on "Advanced" and say me what's there on the "Entry Point" field. Is that empty?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi Rajesh,
I installed language pack and prepared a trial UNICODE application.
Even though i have language pack installed i was not able to see japanese font in text box.
When i paste the japanese string it shows some square boxes.
After that i did this
CFont* pFont;
pFont = new CFont();
pFont->CreateFont(
20,
0,
0,
0,
FW_NORMAL,
TRUE,
FALSE,
0,
DEFAULT_CHARSET ,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("MS Gothic"));
m_Edit.SetFont(pFont);
And now i can paste japanese as well as chinese strings in the text box.
I am not sure why this is the behavior.
Regards,
Sandip.
|
|
|
|
|
Not that I'll be able to guess and "point out" what exactly would cause this. Normally, you don't have to set the font manually as you are using Unicode.
I don't know your version of VS, so I'll take VS 6.
1. Install the Unicode languages on your system that you would like your app to handle.
2. Create a new project, I'll take the simplest MFC dialog.
3. Drag an edit box on the dialog.
4. Go to the project settings and reach the C/C++ tab. Replace _MBCS with _UNICODE .
5. Reach the "Link" tab. Select "Output" in the category combo box. Leave the base address empty and set wWinMainCRTStartup as the Entry-point symbol for your app.
6. Build and run the app. It must now handle any Unicode language that is installed on your machine.
Works?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: I don't know your version of VS, so I'll take VS 6.
Yes it is VS6.0
Rajesh R Subramanian wrote: 2. Create a new project, I'll take the simplest MFC dialog.
3. Drag an edit box on the dialog.
I did same thing.
Rajesh R Subramanian wrote: 4. Go to the project settings and reach the C/C++ tab. Replace _MBCS with _UNICODE.
Done...
Rajesh R Subramanian wrote: 5. Reach the "Link" tab. Select "Output" in the category combo box. Leave the base address empty and set wWinMainCRTStartup as the Entry-point symbol for your app.
This is a must without this you get linker error.
Rajesh R Subramanian wrote: 6. Build and run the app. It must now handle any Unicode language that is installed on your machine.
Tried pasting Japanese string but it shows only square boxes.
One thing i noticed is wordpad / msword will automatically change the font to MS Gothic when you paste the japanese string. And with notepad unless you change it manually to MS Gothic you cant see the Japanese strings..
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: Tried pasting Japanese string but it shows only square boxes.
Japanese characters themselves look like small squares. Are you sure they are not Japanese characters? Nah, just kidding.
Multilingual computing can be a pain at times. I am not sure what causes this behavior, even after doing a Unicode build and having the appropriate languages installed. Never happened to me. If I find a clue, I'll let you know too.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
SandipG wrote: And with notepad unless you change it manually to MS Gothic you cant see the Japanese strings..
Huh? How did I miss this? There's no such thing that you should be doing. I never had to do any such thing. You paste Unicode and that should be pasted and displayed properly right away. Sounds very strange to me.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: There's no such thing that you should be doing.
Is it ?? May be i don't know. Didn't try it before??
I saw the behavior in msword and wordpad sp tried in notepad and worked
Regards,
Sandip.
|
|
|
|