Skip to content

Conversation

@jototland
Copy link

In a windows terminal, the character set is typically not UTF-8. This means that Windows users will most likely read and/or write wrong data when using vim-dadbod, if they use characters outside ASCII.

This patch does two things to fix this problem:

  1. Prepend chcp 65001 before the command of any database tool used by dadbod, but only when running on Windows. Code page 65001 is Microsofts name for UTF-8. (This fixes reading from most database tools)
  2. Add command-line arguments to sqlcmd (used to communicate with SQL Server) to use utf-8. (This was necessary to write data correctly to sqlserver. It might not be needed on other platforms than windows, but certainly does not hurt. Other tools might need similar fixes).

See also #193

In a windows terminal, the character set is typically *not* UTF-8. This
means that Windows users will most likely read and/or write wrong data
when using vim-dadbod, if they use characters outside ASCII.

This patch does two things to fix this problem:
  1. Prepend `chcp 65001` before the command of any database tool used
     by dadbod, but only when running on Windows. Code page 65001 is
     Microsofts name for UTF-8. (This fixes reading from most database
     tools)
  2. Add command-line arguments to sqlcmd (used to communicate with SQL
     Server) to use utf-8. (This was necessary to write data correctly
     to sqlserver. It might not be needed on other platforms than
     windows, but certainly does not hurt. Other tools might need
     similar fixes).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant