Conversion: hex to unicode

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kenny

    #1

    Conversion: hex to unicode

    Hello, I have a problem converting a hexadecimal string to unicode text and
    save it to a file.
    I do not know how to make it, so I ask here...
    And I had much problems replacing unicode strings directly without first
    converting to hex, so I think that is the best method now.
    Thats the basic structure:


    Dim enc As System.Text.Enc oding = New System.Text.Uni codeEncoding(Fa lse,
    False)

    Using f As New IO.FileStream(f oundFile, IO.FileMode.Ope n,
    IO.FileAccess.R ead)
    Dim b As Integer = f.ReadByte()
    Dim output As New Text.StringBuil der
    Do While b >= 0
    output.Append(b .ToString("X2") )
    b = f.ReadByte()
    Loop
    file1 = output.ToString
    End Using

    Dim outputhex As String = Replace(file1, hex1.Text, hex2.Text,
    1, -1)

    Microsoft.Visua lBasic.FileIO.F ileSystem.Write AllText("test.u ni",
    outputhex, False, enc)



    I will be thankful for every answer.

    kenny
Working...