Does anyone know how I can express inputted japanese character-numbers, (1234567890) as normal integer values (1234567890)
if im writing an application for a japanese user and they enter on the form in a textbox "7", in the japanese font, how can i convert this as intger 7?
if i get the textbox.text value, it doesnt convert to an intger, even the char datatype doesnt like it.
thats not really answering my question, just restating it.
Name:
Anonymous2010-02-27 7:43
FIND OUT UNICODE VALUES FOR THEM. I ASSUME THEY ARE IN SEQUENCE.
MUCH IN THE SAME AS FINDING THE INTEGER VALUE OF AN ASCII NUMERICAL DIGIT (IE char c = '7'; int i = c - '0'; )
>>6
thats just repeating what you learned in the first pages of K&R, a book that every programmer should read and im too ignorant to read "books"
doesnt answer my question
here let me make some more posts without punctuation and eventually post some code without code tags
Name:
Anonymous2010-02-27 8:07
>>8
HAY I DIDNT READ K&R EXPERT PROGRAMMERS HAVE AN INSTINCTIVE KNOWLEDGE OF PROGRAMMING
Function AsciiEncode(ByVal value As String) As String
Dim encValue As New System.Text.StringBuilder(value.Length * 6)
Dim c As Char
' encode each char to its ASCII representation
For Each c In value
encValue.Append("")
encValue.Append(Convert.ToInt32(c))
encValue.Append(";")
Next
Return encValue.ToString()
End Function
its not perfect, but it will work :)
Name:
Anonymous2010-02-27 8:11
I was hoping there was a way around finding the unicode value of the text and using that when a textbox was changed, since vb.net has loads of features hidden away... perhaps someone had allready had this problem and solved it without conversion code or lookup tables
Theres no need to be an elitist bastard if I ask a question you may have a solution for. I was hoping there would be a away to do what i wanted without resorting to unicode char conversion every time the the keyboard was pressed. I hope your happy you made me cry. fuck you.
Is the input done in Unicode form or SJIS? Just use whatever API is appropriate to convert to Unicode if it's SJIS and then write your own atoi routine which supports Japanese 0-9 characters, it should be rather easy (get the charcode of 0, and handle it like you would with normal ASCII characters, except sizeof(wchar_t) is 2, not 1).