Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other hexagora products
 Programs (Programmi)
 [HELP] UTF8toString not working
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sfi_dev
Practical

37 Posts

Posted - 20 Jul 2012 :  01:53:39  Show Profile  Visit sfi_dev's Homepage  Reply with Quote
Hi there,

There seems to be a bug maybe in the conversion of utf8tostring when the non-unicode regional settings of the PC are not English.

I have a sample program where I convert unicode text in your control to UTF8 and then back again to unicode - This does not work when the regional settings of the PC are set to something other than English e.g. Korea (as it would on a korean desktop)

Your help would be very much appreciated - what am I doing wrong ??

Basic sample vb6 program and document showing the issue can be found at www.sfi.com.au/download/temp/unicode_issue.zip

Thank-you

Julie

sfi_dev
Practical

37 Posts

Posted - 20 Jul 2012 :  02:21:33  Show Profile  Visit sfi_dev's Homepage  Reply with Quote
Can I add that I tested UTF8conv.exe going from UTF16->UTF8 and back again and the issue does not occur so it is something that I am doing wrong. Is there source available for utf8conv ?
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 20 Jul 2012 :  09:51:22  Show Profile  Visit s.dav's Homepage  Reply with Quote
you cannot use a standard textbox (with ANSI encoding) on non ANSI locales (like Korean) for UTF8 strings because UTF8 encoding uses extended ASCII chars so it cannot contain right characters

use a Unicode Textbox also for UTF8 strings in your app

If you need to absolutely use a standard ANSI textbox use our HEX encoding instead of UTF8


Regards, Davide
Go to Top of Page

sfi_dev
Practical

37 Posts

Posted - 20 Jul 2012 :  10:36:33  Show Profile  Visit sfi_dev's Homepage  Reply with Quote
Thanks for that -
Hex poses a few more problems given the length it returns.

is it a better option if I use strconv to convert and store as ascii then ?


Julie
Go to Top of Page

sfi_dev
Practical

37 Posts

Posted - 20 Jul 2012 :  12:46:21  Show Profile  Visit sfi_dev's Homepage  Reply with Quote
Sorry one more thing, do your controls allow me to change the locale that is to be used programmatically - e.g. always use English etc ? This will solve all my issues ?

Everything works as expected except when non Ansi locales are used.

Thanks for your support. This is my last issue.

Kind Regards Julie
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 20 Jul 2012 :  16:02:34  Show Profile  Visit s.dav's Homepage  Reply with Quote
Julie, I sent you a sample
If you want to change Windows locale you need to use relative Windows Apis

Regards, Davide
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000