Re: Storing Special Characters

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Storing Special Characters
Date: 2013-05-14 17:32:41
Message-ID: CA+6hpak0Z35nuWOptfQQzGtyPOqL_zsCNKiLoGN1qkrarj1KCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The UTF-8 encoding for a pound sign is 0xc2a3, not just 0xa3. You
might want to make sure your PHP file is correct. If you're on Linux,
you can use a command like `od --format=ax1 foo.php` to see the actual
byte values. If that shows the wrong value, then the problem is your
text editor is saving the file in the wrong encoding. If the value is
right, then the problem is further downstream.

Good luck!
Paul

On Tue, May 14, 2013 at 10:15 AM, Leif Biberg Kristensen
<leif(at)solumslekt(dot)org> wrote:
> 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
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
_________________________________
Pulchritudo splendor veritatis.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2013-05-14 19:16:19 check_postgres_last_vacuum for all databases
Previous Message Ioana Danes 2013-05-14 17:25:26 Re: Running out of memory on vacuum