I need to be able to open a text file with Unicode content (Chinese characters and Pinyin).
Using the following code I am able to read the first Chinese character correctly, but NOT the following Pinyin. The next character is read, but is again incorrect. Only plain Asci characters are loaded corectly.
How can I fix this? and how can I display this Unicode on a PBWin label control (I don't want to use the richtextbox because everything needs to stay read-only)?
Using the following code I am able to read the first Chinese character correctly, but NOT the following Pinyin. The next character is read, but is again incorrect. Only plain Asci characters are loaded corectly.
Code:
SUB LoadCharacters () DIM strTempChar AS STRING DIM strTemp AS STRING DIM strTempMeaning AS STRING OPEN "data\Chinese.dat" FOR INPUT AS 1 WHILE ISFALSE EOF(1) ' check if at end of file LINE INPUT #1, strtempchar strtemp = PARSE$(strtempchar,1) UniMsgBox BYVAL 0, STRPTR(strtemp), 1, BYVAL 0 strtempmeaning = fixtextline(PARSE$(strtempchar,2)) MSGBOX strtempmeaning intcounter = intcounter + 1 REDIM PRESERVE strCharacter(intcounter) REDIM PRESERVE strMeaning(intcounter) strCharacter(intcounter) = strtempchar strMeaning(intcounter) = strtempmeaning WEND CLOSE 1 END SUB
Comment