Home > database >  PostgerSql gibberish to Chinese characters display in the table 9.3 how broken
PostgerSql gibberish to Chinese characters display in the table 9.3 how broken

Time:10-04

Sqlshell inside display is normal, but the browser data in the table is square Chinese characters, how to solve the

CodePudding user response:

1, connect the client script, such as: (PHP)
$conn=pg_connect (" host={$pgsql_server_name} user={$pgsql_username} password={$pgsql_password} dbname={$pgsql_database} ");
Pg_exec ($conn, "set client_encoding to 'GBK'");//utf8


2, the HTML

<meta content="text/HTML. GBK charset="HTTP - equiv=" content-type "/& gt;
In several places to modify try
  • Related