Article ID: 193540
Article Last Modified on 3/7/2005
224305 INFO: Usage and Redistribution of FM20.DLL [OffDev]
Private Sub Command1_Click()
' create a Unicode text file with Chinese character
' Dan1 and English character D.
Dim a(0 To 5) As Byte
a(0) = &HFF
a(1) = &HFE
a(2) = &H39
a(3) = &H4E
a(4) = &H44
a(5) = &H0
Open "unicode.txt" For Binary As #1
Put #1, , a
Close #1
End Sub
Private Sub Command2_Click()
Dim txtline As String
' you may need to change the path of the file
Open "unicode.txt" For Binary As #1
txtline = InputB(2, #1) ' always FF FE, skip them
txtline = InputB(4, #1)
Close #1
TextBox1.Text = txtline ' display the string
End Sub
Note that the UNICODE text file always begins with the Bytes FF FE,
which is why you need to skip these two bytes. Also note that to read
UNICODE strings from a file, the file needs to be opened as binary and
read using InputB.177561 How To Add and Enable Additional Languages in Windows NT
224305 INFO: Usage and Redistribution of FM20.DLL [OffDev]
Keywords: kbhowto kbunicode kbctrl KB193540