It seems that libcsv does not use the C line functions to do its job, so it almost works out of the box, despite its ignorance of mbcs / ws. It treats the string as an array of bytes with an explicit length. This can basically work for certain wide-character encodings that upload ASCII bytes to fill the width (so a new line can be encoded as "\ 0 \ n" and the space as "\ 0"). You can also encode your wide data as UTF-8, which should make things a little easier. But both approaches can be based on how libcsv identifies space and line terminator markers: it expects you to say it byte-byte, regardless of whether it looks at a space or terminator, which does not allow multibyte spatial / terminal encodings You can fix it,changing the library to pass the pointer to the string and the length remaining in the string to its space / term check functions, which would be pretty simple.