Results 1 to 14 of 14

Thread: [VB6] How to correctly display Chinese and Japanese characters.

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    3

    Question [VB6] How to correctly display Chinese and Japanese characters.

    Hello VBForums,

    I'm working on making a current VB project able to be used in several different languages.

    This is currently being done by creating a RC file with the translations entered, which is then exported to an RES file before being loaded into the VB6 project. Then at run time, the RES file is parsed and labels are then replaced accordingly.

    The issue I'm having is that the menu items are not displaying the Kanji/Katakana/Hiragana characters at all. I am using NJStar to view the foreign characters within VB6, and currently have it set up to read/detect UTF-8 encoding.

    Screenshot of the issue; https://dl.dropbox.com/u/22038575/vb_jap_issue.jpg

    I've tried searching around, and I've learnt that VB6 doesn't get on well with UNICODE; however the majority of the labels do display correctly. It is the "File" menu text that refuses to show up correctly.

    Does anyone have a possible solution to my issue?

  2. #2
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Solution #1
    I have not looked into menus but if it does not work (and you tried everything) then you might have to make your "own" menus with a Unicode Control

    Solution #2
    You could probably use api to get the text into the menu's caption but i have never tried that and it will be harder to do then #1

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    3

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Thanks for the reply, Max.

    Solution 1: Yes this could work, however the title bar would still have garbeled text. This may also mean I'd have to refactor some code I didn't want to have to touch.

    Solution 2: Actually this sounds like a good idea, though I have no experience in using the API. I'll have a look into it!

    Thanks for the suggestions!

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    For Unicode menus, check out this tutorial: http://www.cyberactivex.com/UnicodeTutorialVb.htm#Menus

    For Unicode Title bar, see Daniel's comments on this PSC submission: http://www.planet-source-code.com/vb...dbackId_322536
    Last edited by Bonnie West; Oct 19th, 2012 at 12:10 PM. Reason: Fixed link
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    3

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Oh fantastic, thank you very much, Bonnie!

  6. #6
    Addicted Member
    Join Date
    Feb 2022
    Posts
    163

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Same Problem: I am trying to read a Chinese UTF-8 text file that displays properly in Notepad++ ( but not Windows Notepad (why?) ) into a standard VB6 label.
    Last edited by taishan; Feb 3rd, 2023 at 04:36 PM. Reason: Meant to directly reply to Bonnie West

  7. #7
    Addicted Member
    Join Date
    Feb 2022
    Posts
    163

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Hi Bonnie, I am a huge fan. You always seem to come up with solutions to the most obscure problems! Both of the websites mentioned are gone, do you have them on file? I am trying to read a Chinese UTF-8 text file that displays properly in Notepad++ ( but not Windows Notepad (why?) ) into a standard VB6 label.

  8. #8
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,294

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    A label is not going to work. You may try to make a PictureBox look like a label and draw your text in there.

  9. #9
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    There are many methods such as:

    - programming
    - Free ActiveX's
    - Free user controls

    If you are looking for something that does not need to be installed and is available in most Windows, this is my suggestion
    microsoft form2 object library (ActiveXControlPad) rarely happens when you need to install ActiveX





    sample attached about use micoroft form2 and read from file or stream or coding :

    Name:  demodemo.jpg
Views: 509
Size:  36.2 KB


    But if you are looking for a user control without the need for ActiveX, which does not require installation or coding, I suggest Label Plus just for display.
    Attached Files Attached Files
    Last edited by Black_Storm; Feb 4th, 2023 at 09:43 PM.
    [ ... active on skype and discord ... ] ,[always strive to achieve your dreams] , [always try,dont stop,never say never]

  10. #10
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,106

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Quote Originally Posted by Black_Storm View Post
    There are many methods such as:

    - programming
    - Free ActiveX's
    - Free user controls

    If you are looking for something that does not need to be installed and is available in most Windows, this is my suggestion
    microsoft form2 object library (ActiveXControlPad) rarely happens when you need to install ActiveX
    Is that being shipped with Windows 10/11 these days? In the past, I thought you needed to have Office installed to have Fm20.dll. Not sure. I know using controls from it in VB6 projects was in the "bad idea jeans" category historically.

  11. #11
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    microsoft form2 object library (ActiveXControlPad)
    In the description above, I mentioned the name of ActiveX for installation, and before posting the previous article, I was able to test it on a Windows XP that only had VB installed without the need to install Office and only installed ActiveXControlPad.
    [ ... active on skype and discord ... ] ,[always strive to achieve your dreams] , [always try,dont stop,never say never]

  12. #12
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,106

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    Quote Originally Posted by Black_Storm View Post
    In the description above, I mentioned the name of ActiveX for installation, and before posting the previous article, I was able to test it on a Windows XP that only had VB installed without the need to install Office and only installed ActiveXControlPad.
    Sorry, I didn't catch what you were referring to at first.

    For the record, for anyone who wants to download the Microsoft ActiveX Control Pad, the Wayback Machine has it available from the link below.

    https://web.archive.org/web/20050103.../html/cpad.asp

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    It was included with VB6 only for use in UserControls to make an OCX for use in MS Office applications and IE pages.

    It was never licensed for redistribution and those controls are not guaranteed to work correctly when hosted in VB6 Forms.

  14. #14
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: [VB6] How to correctly display Chinese and Japanese characters.

    As for Microsoft Form 2, I tried to test it in the worst possible case, and of course I used it in several projects in Windows 7 64bit , and now that I am using Windows 8 64 bit, I had no problems using it. although I mentioned that these were just two suggestions. , otherwise there are other examples, other types of controls can be used.
    For another suggestion, I can suggest
    - Krools Common Controls based on OLEGuids, which exists like as ocx and user control in the forum
    - Code jock also supports Unicode but it is paid like as some other activex's
    -Inked.dll
    - free unicontrols user control :


    and many other things
    Last edited by Black_Storm; Feb 4th, 2023 at 10:50 PM.
    [ ... active on skype and discord ... ] ,[always strive to achieve your dreams] , [always try,dont stop,never say never]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width