How to charset Encoding SQL_ASCII To UTF8? lazarus / 16-Databases ---------------------------------------------------------------------- tongchimlang · 2016-03-24 06:40 hello, i want to ask about  charset . PostgreSQL  Encoding :SQL_ASCII i just connecting to my Postgres db and i got my varchar field showing weird characters in my dbgrid also try to change my grid font charset to Encoding but nothing happened sorry if my english weird . (please take a look my attachment) ---------------------------------------------------------------------- Zoran · 2016-03-24 08:21 I don't use postgres, but maybe you set your client encoding wrong - see the PQConnection component's property CharSet in object inspector. What did you put to CharSet property of PQConnection? Set it to UTF-8 and try then. It should be UTF-8. The property tells to server what the client encoding is, which is always UTF-8 in LCL. It is mistake is to put the server encoding in this property. ---------------------------------------------------------------------- tongchimlang · 2016-03-24 09:47 Set in to UTF-8 and UTF8 Not work. ---------------------------------------------------------------------- LacaK · 2016-03-28 16:56 UTF8 should work. In your screenshots seems results to be same ... at least something should change if you set right char set. What is your Lazarus version ? Can you try 1.6 ? ---------------------------------------------------------------------- tongchimlang · 2016-03-29 07:01 Lazarus version 1.6 ---------------------------------------------------------------------- tongchimlang · 2016-04-29 08:25 help me please.. Thank. ---------------------------------------------------------------------- zeljko · 2016-04-29 08:54 if client_encoding is UTF-8 then it should work, not sure what happens if server is SQL_ASCII. Can you exec query via PQ component: SHOW client_encoding; ? What's result of SELECT datname,encoding,datcollate,datctype FROM pg_database; ? What's postgresql version ? ---------------------------------------------------------------------- zeljko · 2016-04-29 08:57 NO, if server encoding is SQL_ASCII then you're out of luck. The SQL_ASCII setting behaves considerably differently from the other settings. When the server character set is SQL_ASCII, the server interprets byte values 0-127 according to the ASCII standard, while byte values 128-255 are taken as uninterpreted characters. No encoding conversion will be done when the setting is SQL_ASCII. Thus, this setting is not so much a declaration that a specific encoding is in use, as a declaration of ignorance about the encoding. In most cases, if you are working with any non-ASCII data, it is unwise to use the SQL_ASCII setting because PostgreSQL will be unable to help you by converting or validating non-ASCII characters. http://www.postgresql.org/docs/9.4/static/multibyte.html