Page 1 of 1
unicode question
Posted: Sun Jun 29, 2008 5:22 am
by loadstone
When I change the sourcefile encoding to utf8 and checked the
"create unicode executable",then <ASC"你"> code can not get the value.
ps: if ansi mode,that can get the value.
"你" is a chinese word.
in VB chinese edition can do this Asc("你")=-15133,meybe VB inside immediately use the uncode?
thank

Posted: Sun Jun 29, 2008 8:03 am
by blueznl
Asc() returns the Ascii value, Unicode characters do not necessarily have an Ascii value, so I fear you cannot rely on Asc() here...
Posted: Sun Jun 29, 2008 9:09 am
by Marco2007
It works for me....
Code: Select all
number=Asc("你")
Debug number
If OpenWindow(0,0,0,300, 400,"") And CreateGadgetList(WindowID(0))
StringGadget(0, 20,20, 200, 30, Chr(number)+ " 你 " + Chr(20320))
SetGadgetFont(0, LoadFont(0, "Arial Unicode MS", 12))
EndIf
Repeat:Until WaitWindowEvent()=#WM_CLOSE
I get 20320 and it looks okay.
Unicode on and Utf-8 enabled.
Posted: Sun Jun 29, 2008 10:50 am
by loadstone
oh,I understand

it work good!!!!

Posted: Sun Jun 29, 2008 3:25 pm
by Rook Zimbabwe
Isn't there some function to return the unicode value? If not we may need a UNI(ñ) feature!

Posted: Sun Jun 29, 2008 3:37 pm
by Marco2007
Well, I don`t have problems with e.g. Asc("‱") + Unicode.
I`ve tried several Unicodes without any problems.
Try it...
For displaying, the right font has to be installed:
http://en.wikipedia.org/wiki/Unicode_typefaces
Posted: Sun Jun 29, 2008 6:34 pm
by Fred
Rook Zimbabwe wrote:Isn't there some function to return the unicode value? If not we may need a UNI(ñ) feature!

Asc() is here for that, where is the problem ?
Posted: Sun Jun 29, 2008 11:03 pm
by blueznl
Fred, does it support all unicode formats / codes? If so a little note in the docs would make sense

Posted: Mon Jun 30, 2008 11:26 am
by Fred
Sure it does, it returns a character, it's not ascii only. I will update the doc.