Click to See Complete Forum and Search --> : converting 16bit strings to 8bit


d.moeller
September 23rd, 1999, 05:11 PM
I'm using LineNumberReader to read lines from a textfile. Everything works cool, but recently I tried to read a windows text file, which seems to be 16bit unicode or something like that. Every character is represented by 2 bytes... no, it's not a .doc file or something, it's plain text.

Now, I need to convert the String to a "normal" 8bit String, so that my following functions can work with this textfile. I could'nt find a function to do this. For now, I'm converting the String by manually copying every second character to another String.

Is there a more handy way to do this?

Thanks!

poochi
September 23rd, 1999, 08:31 PM
Use RandomAccessFile.

d.moeller
September 24th, 1999, 01:59 AM
Well, I'm checking those strings character for character anyway. I just thought there would be a function to do this.