Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

I would like to collect some usefull tips to cover the following issue:

I am trying to get on a text box, the registered symbol displayed but when I running the application on a windows 7 chinese, it is replaced by a ?.

I have found the unicode number is U+AE. How could I decode it to prompt the corresponding symbo ?

I have also used the same font from notepad on the chinese windows 7 os (simsun) but still no difference.

I know this is vb6 I am using and you are telling me to use vb.net but if I had the choice, I would not ask you that question.

I really hope somebody has already been also in front of that issue.

A big thank you very much in advance.
Best regards.
MiQi

What I have tried:

I have tried the following:
Changing to different fonts:

Font.Name = "Arial Unicode MS"
Font.Size = 12

MsgBox "Chinese" & StrConv("®", vbFromUnicode)
MsgBox ChrW(&HAE)

Form1.frm

I have also tried font "Tahoma" but still the same effect.

I have also found fm20.dll which may cover some controls but would be more interested to unique way to also be used with msgBox.
Posted
Updated 16-May-17 7:01am
v3

1 solution

While VB6 stores strings internally with Unicode, it does not support Unicode for controls like text boxes. All strings are converted to ANSI/MBCS using the current code page. If that does not contain a match for the Unicode character, the ? character is used (which probably happens here for a Chinese code page).

See Display Unicode Strings in Visual Basic 6.0[^] for a detailed description.

The solution: Use a more recent VB version.
 
Share this answer
 
Comments
SuperMiQi 15-May-17 11:56am    
Hello Sir,
Thank you for the info but I tried the sample program and it gives also funny effect. The second chinese character is not correctly displayed.

I am even not involved with chinese character but with this single ® symbol.
I assume this is related to font but which one.

This is a vb6 project used by a customer and later on this year this will be converted to vb.net but for the time beeing a hint would be really appreciated.

Thank you very much in advance.
Best regards,
MiQi
Jochen Arndt 16-May-17 3:05am    
The Registered symbol has the Unicode code point U+00AE and the same (HAE) with Western code pages. So it should be displayed when actually using a Western code page when running the application. It should also not be necessary to use the StrConv function. Have you tried that?

The font should not matter because most - if not any - should provide the symbol.

Only if the actually used code page does not contain the symbol it should be replaced with a question mark.
SuperMiQi 16-May-17 12:32pm    
What is the western code page ?
In all example, it refers the code page to 134 (Simplified Chinese, gb2312 - Mainland China(PRC) and Singapore). I am certainly missing something basic but I do not figure out currently what could be the issue.
Do you have a way to provide me an example code ?
Thank you very much in advance.
Best regards,
MiQi
Jochen Arndt 16-May-17 12:40pm    
The code page is set according to the local Windows setting (language).
See also https://en.wikipedia.org/wiki/Windows_code_page.
While not used with recent Windows versions anymore, they are still supported to support old application that are not Unicode aware like VB6 applications.

Western code pages are those using Latin characters. If you select a Western language like English, your code should work. But if you use other languages like Chinese or Japanese your code will probably not work. But when selecting a Western code page, Chinese or Japanese characters are not supported anymore.
SuperMiQi 16-May-17 12:56pm    
Hello Jochen
Thank you for your reply but I am still wondering why on top of chinese characters it is not so easy to get this symbol ® available/displayed ?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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