Re: Storing Special Characters - Mailing list pgsql-general

From Leif Biberg Kristensen
Subject Re: Storing Special Characters
Date
Msg-id 1479788.Ki0T84dqFb@balapapa
Whole thread Raw
In response to Storing Special Characters  (Rebecca Clarke <r.clarke83@gmail.com>)
Responses Re: Storing Special Characters
List pgsql-general
Tirsdag 14. mai 2013 18.05.05 skrev Rebecca Clarke:
> Hi there.
>
> This may be the wrong forum to inquire in, but I'd be grateful if I could
> directed in the right direction if that is the case.
>
> I am currently using Postgresql 9.1.
>
> I have a table in which I want to store shop names. Some of the shop names
> contain 'é' and '£'.
>
> The query below works when I run it through pg_admin:
>
> insert into retail(storename) values ('£'::character varying)
>
> However, when I run the same query through pg_query in PHP, I get:
>
> PHP Warning:  pg_query(): Query failed: ERROR:  invalid byte sequence for
> encoding "UTF8": 0xa3

It's possibly a client encoding problem. See the PHP documentation on

http://php.net/manual/en/function.pg-set-client-encoding.php

regards, Leif


pgsql-general by date:

Previous
From: Rebecca Clarke
Date:
Subject: Storing Special Characters
Next
From: Jeff Janes
Date:
Subject: Re: How to clone a running master cluster?