Ou should know what encoding is used in your database. Show server encoding


Download 18.54 Kb.
Sana24.09.2023
Hajmi18.54 Kb.
#1687322
Bog'liq
test


ou should know what encoding is used in your database.
SHOW server_encoding;
When you connect to your database you can specify what encoding should your client use:
SET client_encoding TO 'UTF8';
If server and client encoding differ, the database driver tries to translate between those two encoding. When it can not find an equivalent character, the error is thrown.
So server encoding and client encoding should be the same to avoid problems like yours.
To fix your problem:

To avoid this problem in the future remember to set client_encoding to proper value when you connect to the database.
Check the documentation on Supported Character Sets.
Share
Improve this answer
Follow
answered Jul 20, 2016 at 18:14





Adam
5,42366 gold badges3131 silver badges3838 bronze badges

  • 1

both are in UTF8 JapanDB=# SHOW server_encoding; server_encoding ----------------- UTF8 (1 row) JapanDB=# show client_encoding; client_enc
Download 18.54 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling