Re: Postgres, apps, special characters and UTF-8 encoding

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres, apps, special characters and UTF-8 encoding
Date: 2017-03-07 23:32:36
Message-ID: CAKFQuwaKx0M_ved3MDisXhM4uZ98Y=6z1CR8ze3YjVyQn0MNtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 7, 2017 at 4:20 PM, Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com> wrote:

> As I understand it, those are likely encoded in something non-UTF-8, like
> WIN-1251 or something. And that one way or another, the encoding needs to
> be translated before it can be placed into the database. I'm not clear how
> this is supposed to happen though. Automatically by the browser? Done in
> the app? Some other way? And if in the app, how is one supposed to know
> what the incoming encoding is?
>

​Haven't run into this problem personally, probably accidentally lucky, but
ISTM that you need to tell the browser what character set you are working
in. It is in the best position to mediate between the user and the server.

Ideally, on the server, you can examine HTTP headers to learn about the
incoming data charset/encoding (I may not be using these terms precisely
but you should get the idea).

Googling "html input field encoding" seems to provide a decent start.

Note that technically the data encoding issues can occur without HTML, its
really an HTTP layer thing, but the medium of use you care about is
HTTP/Browsers.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-03-08 00:25:52 Re: Postgres, apps, special characters and UTF-8 encoding
Previous Message Ken Tanzer 2017-03-07 23:20:48 Postgres, apps, special characters and UTF-8 encoding