pekim/tedious — pull request #18 by phipla (2012-03-07 14:15:02+00:00)
Title: Ability to use single-byte legacy-encoded (non-ASCII) text fields

Hi,

To import a legacy Microsoft SQL Server database using Latin1 characters into node.js, I had to make this small change in tedious. This change should not break anything (it breaks none of the unit tests, at least, and works in my app).

---

Use "binary" instead of "ascii" encoding for single-byte text columns, so that legacy-encoded non-ascii characters are preserved and not replaced by the invalid character.

If the code page for the database is not iso-8859-1 / latin1, this means that those characters will be wrong, but they will not be destroyed and it will at least be possible to iconv them.

A better solution might be to specify the character encoding as an option, and add iconv as a dependency. I may make such a patch if you are interested.

Regards, Philippe