I'm having problems with the ByteConverter libary. I read the bytes from the file, and if I move the byte array to the TextEdit they are in fact the value of the ascii
chars in the file. When I BConverter.CharsFromBytes and move the char buffer to the TextEdit they're displayed as chinese chars. I then added an ascii string to the TextEdit and it's displayed correctly
Sub
WriteFile_Click
Dim buffer(1000) As Byte
Dim cbuff(1000) As Char
Dim In1 As InputStream
Dim BConverter As ByteConverter
Dim count As Int
In1 = F
ile.OpenInput(File.DirRootExternal,"FSCREEN.TXT")
In1.ReadBytes(buffer,
0,100)
cbuff = BConverter.CharsFromBytes(buffer)
For count = 0 To 100 Step1
TxtEdit.Text = TxtEdit.Text & buffer(count) & " "
Next
For count = 0To100Step1
TxtEdit.Text = TxtEdit.Text & cbuff(count)
Next
TxtEdit.Text = TxtEdit.Text & " SSSSSS"
End Sub
chars in the file. When I BConverter.CharsFromBytes and move the char buffer to the TextEdit they're displayed as chinese chars. I then added an ascii string to the TextEdit and it's displayed correctly
Sub
WriteFile_Click
Dim buffer(1000) As Byte
Dim cbuff(1000) As Char
Dim In1 As InputStream
Dim BConverter As ByteConverter
Dim count As Int
In1 = F
ile.OpenInput(File.DirRootExternal,"FSCREEN.TXT")
In1.ReadBytes(buffer,
0,100)
cbuff = BConverter.CharsFromBytes(buffer)
For count = 0 To 100 Step1
TxtEdit.Text = TxtEdit.Text & buffer(count) & " "
Next
For count = 0To100Step1
TxtEdit.Text = TxtEdit.Text & cbuff(count)
Next
TxtEdit.Text = TxtEdit.Text & " SSSSSS"
End Sub