rodhoward / node-sybase

23 stars 55 forks source link

UTF8 issue #12

Closed sacuba closed 7 years ago

sacuba commented 7 years ago

i met an issue when my table got utf8 content. throw er; // Unhandled 'error' event ^ Error: Invalid JSON (Invalid UTF-8 character at position 10312 in state STRING1) at Parser.proto.write (C:\work\git\CCS\migration\node_modules\jsonparse\jsonparse.js:171:31) at Stream. (C:\work\git\CCS\migration\node_modules\JSONStream\index.js:23:12) at Stream.stream.write (C:\work\git\CCS\migration\node_modules\through\index.js:26:11) at Socket.ondata (_stream_readable.js:555:20) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at Pipe.onread (net.js:551:20)

rodhoward commented 7 years ago

I have accepted a pull request that might fix this issue. Basically it sets the encoding on the output stream to be UTF8. Please let me know if that solves your problem as I have no way to test anymore I have moved on from Sybase!!!

sacuba commented 7 years ago

it did fix my issue. Thank you very much!