node-readlines icon indicating copy to clipboard operation
node-readlines copied to clipboard

UTF-16

Open netmiller opened this issue 6 years ago • 3 comments

Any advise how to read utf-16 (LittleEndian) file info buffer. Tried normal way :

while (row = reader.next()) {
    line = row.toString('utf16le');
    ........
}

but seems to be incorrect ?

netmiller avatar Sep 06 '18 11:09 netmiller

would probably be best to fork and update the search for the newline pairing. just curious why not utf8?

tracker1 avatar Jan 22 '19 21:01 tracker1

would probably be best to fork and update the search for the newline pairing. just curious why not utf8?

The data source could be UTF-16LE encoded, and one wants to handle raw lines of data. Example: sync, read/compare windows files from a machine with fixed encoding (UTF-16LE)

Actually the project should support any source encoding.

jforge avatar Nov 09 '20 11:11 jforge

Actually the project should support any source encoding.

I'm not sure if this is still an issue, but I believe it's working? I have a dynamic encoding detection with chardet, and I use that value with row.toString(encoding) and I correctly get the string I want.. from my code samples.

@netmiller The exact encoding I use is UTF-16LE. Maybe you need to pass that instead of utf16le.

quoininc-huudatran avatar Mar 03 '21 22:03 quoininc-huudatran