Skip to content

Unicode translation regression between 7.0.6 and 8.0.0-rc2 #5351

@johnfedak

Description

@johnfedak

Just upgraded my application from Npgsql 7.0.6 to the current 8.0.0-rc2 and am getting the following exception querying some (but not all) varchar fields.

Unable to translate bytes [81] at index 30 from specified code page to Unicode.
at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderFallbackBuffer.InternalFallback(Byte[] bytes, Byte* pBytes)
at System.Text.UTF8Encoding.GetCharCount(Byte* bytes, Int32 count, DecoderNLS baseDecoder)
at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
at System.Text.EncodingExtensions.GetString(Encoding encoding, ReadOnlySequence1& bytes) at Npgsql.Internal.Converters.StringBasedTextConverter1.Read(Boolean async, PgReader reader, Encoding encoding, CancellationToken cancellationToken)
at Npgsql.Internal.Converters.StringBasedTextConverter1.Read(PgReader reader) at Npgsql.Internal.PgStreamingConverter1.ReadAsObject(Boolean async, PgReader reader, CancellationToken cancellationToken)
at Npgsql.Internal.PgConverter.ReadAsObject(PgReader reader)
at Npgsql.NpgsqlDataReader.GetValue(Int32 ordinal)
at Npgsql.NpgsqlDataReader.GetValues(Object[] values)

Before I isolate this into an external replication case, is there anything obvious that changed between 7.0.6 and 8.0.0 that I should be aware of? Nothing jumped out at me in the release notes.

Server and client encodings are UTF8.
Using classic .Net 4.8 on Windows, DB is RDS hosted PostgreSQL 15.4

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions