'How do I handle an encoding error in Excel Power Query?
I receive the following error when connecting to a Postgres database.
DataSource.Error: ODBC: ERROR [22P05] ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1252"; Error while executing the query Details: DataSourceKind=Odbc DataSourcePath=database=XXXXXXXX;dsn=PostgreSQL30;encoding='utf-8';port=XXXX;server=XXXXXXXXX OdbcErrors=Table
It only happens with this table, so the connection works in general. I would prefer to deal with this at the excel level and not make changes to the database. I tried including 'encoding='utf-8' in the connection string, but I see that the problem isn't that excel doesn't recognize the encoding scheme but that it doesn't have a process to handle 0xc2 0x96 in WIN1252.
Is there a way to change excel default encoding or a way to specify it in the connection string or query settings to handle this?
Solution 1:[1]
Solved by installing the unicode Postgres driver and setting the dsn to it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Spencer_Webb |
