Jump to content

How manage unicode chars for chinese text?


Recommended Posts

Hello,

 

I've a project with a multilanguage feature... at the start the application read into its .ini file the language to be used and then loads all the texts into a text file in that language...

 

This works finely for "Occidental" languages but now I ought to use chinese characters enabling unicode...

 

I tried with the instruciotns found on the web, but... 

 

1 - all chars are doubled probably due to the different size of ascii chars and unicode ones (e.g. "hello" becomes "h e l l o ") - but this can be managed  :unsure:

2 - also EOLs are doubled - but also this can be managed  :wacko:

3 - chinese text are appeared - and this was what I was looking for  :beer_mug:

4 - going back to the english language all the ascii letters became chinese-styled...  :oops:  and to have back them I had to disable the unicode management...  :throwpc:

 

Does anyone have some solution?

 

Thanks

Max

Link to comment

yes, I checked that document, but the only thing that I can manage is a text file... loading it in a string forced to be a unicode string I find english and/or chinese characters... but if I try to extract a portion of that text to be inserted in an array... all the characters, latin or chinese changes in others that have no significance in any language...

 

 

original in text file: Home;家 (the same reading I find in the text box)

 

after transfer in array : 䌀愀猀愀 (this should be home in latin letters)    (and this is not the same as the previous and has no meaning in chinese)

 

Max

Link to comment

Labview doesn't (officially) support Unicode. There is a "hack" to display Unicode chars in indicators, but all labview functions/primitives still only support ASCII.

You need to use the library that Tim_S linked to to even have a chance of manipulating unicode chars, which you are obviously not using.

Link to comment
Thanks ShaunR... your clear analisys of what was wrong help me find a solution... just I will use a file for each language instead of an unique file for the all languages... but it seems to be great...

 

:worshippy:

 

Max

Well. I've been there. I wrote a library for changing UI elements "on-the-fly" (passa mak). I deliberately excluded unicode since it is platform dependent, but it could be modified for a particular use case.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.