Open sfc-gh-cgorrie opened 1 month ago
We may need to use a tool like https://github.com/jawah/charset_normalizer
I think we could get away with something a little lighter-weight and more deterministic. BOM detection alone will solve the standard codepath for Windows, and if we give users the ability to use (python-standard? *nix locale?) env vars to match any overrides they've made on their local system, that coverage should be enough to resolve this ticket.
SnowCLI version
2.6.0rc0
Python version
Python 3.11.9
Platform
macOS-14.5-arm64-arm-64bit
What happened
Powershell redirects (e.g. command > file) by default encode output using UTF-16LE. Unfortunately, Snowflake CLI in a lot of paths is assuming utf-8 encoding, which makes common workflows fail there. Here's an example PR that simply changes the input for a snow sql -f command to use that encoding, showing the failure: #1299
Console output