Welcome to Dream.In.Code
Become a VB Expert!

Join 137,231 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,826 people online right now. Registration is fast and FREE... Join Now!




converting character in hexadecimal

 
Reply to this topicStart new topic

converting character in hexadecimal

larimore
19 Mar, 2007 - 09:30 PM
Post #1

New D.I.C Head
*

Joined: 18 Mar, 2007
Posts: 11


My Contributions
hello guys..i got a little problem, i really appreciate if you can help me

i got public variable
Public errorData as byte() = { &H0, &H4e} 'it goes longer than this

i input hexa codes in the errorData and use binary writer to write TSB files..the problem is
when it read alpha character

here is codes that produce error


Do While y <= 15 and strError(z).Substring(y - 1, 1) <> ""
errorData(91 + y ) = Convert.ToByte(Hex(Asc(strError(z).Substring(y - 1, 1))))
If y = 15 Then
errorData(91 + y +1) = &HD
errorData(91 + y + 2) = &HA
End If
y += 1
Loop

if the Current SubString is "E"(for example) i get 45(which is correct) but if its in japanese "ハ" which should be CA
i get an error which read


System.FormatException - input character type is incorrect

This post has been edited by larimore: 19 Mar, 2007 - 09:34 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 03:28PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month