I have an old postgresql database (in production) that uses ascii encoding. I'm creating a new c# .net application using npgsql entityFrameWorkCore but I always get encoding errors:

System.Text.DecoderFallbackException : Unable to translate bytes [xx] at index yy from specified code page to Unicode

I found this similar problem:

Cannot select some rows with npgsql on a "Portuguese" database

It looks on that page that support was added for non-ascii characters. But this does not seem to work in npgsql 2.2 Upgrading the database is no option. Any idea what I can do to read my data?

1 Answers

0
Shay Rojansky On

As written in the issue you've linked to above, the support for non-UTF8 encoding was added to Npgsql 3.1.8 - so 2.2 doesn't have it. 2.2 is also really old by now (and completely unmaintained/unsupported) - you should upgrade to the latest version of Npgsql (note this doesn't imply upgrading your database).