The issue
when using copy importer from binary to witer text column with emoji
before writer, substring(0, 500) for string
Exception message: Unable to translate Unicode character \\uD83D at index 499 to specified code page.
Stack trace:
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
at System.Text.UTF8Encoding.GetByteCount(String chars)
at Npgsql.TypeHandlers.TextHandler.ValidateAndGetLength(String value, NpgsqlLengthCache& lengthCache, NpgsqlParameter parameter)
at lambda_method(Closure , NpgsqlTypeHandler , Object , NpgsqlLengthCache& , NpgsqlParameter )
at Npgsql.NpgsqlParameter.ValidateAndGetLength()
at Npgsql.NpgsqlBinaryImporter.Write[T](T value, NpgsqlParameter param) // T is string
Further technical details
Npgsql version: 4.0.7
PostgreSQL version:
PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit
LC_CTYPE=zh_CN.UTF-8
LC_COLLATE=zh_CN.UTF-8
Operating system (App):
CentOS Linux release 7.2.1511 (Core)
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
The issue
when using copy importer from binary to witer text column with emoji
before writer, substring(0, 500) for string
Further technical details
Npgsql version: 4.0.7
PostgreSQL version:
Operating system (App):