Re: GeoIP Character Encoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Jul 2009 18:10:33 -0400, APseudoUtopia wrote:

> 'Portugal, 09, Vila Real De Santo António'
> 'Norway, 08, Ålesund'
> 'Portugal, 04, Vila Nova De Famalicão'
> 
> (Note the ó, Å, and ã).
> 
> I'm using PostgreSQL as my database. The database's encoding is UTF8,
> and the locale is C.
> 
> When I try to insert the above strings into a VARCHAR column, I get
> errors similar to the following:
> 
> ERROR:  invalid byte sequence for encoding "UTF8": 0xf36e696f
> ERROR:  invalid byte sequence for encoding "UTF8": 0xc56c
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe36f2c
> 
> Now, I believe I can solve the problem by changing the client_encoding
> of my postgresql client (Right now, it is set to UTF8). However, I'm
> trying to figure out what encoding the GeoIP function is returning to
> me so that I can set the client_encoding appropriately. Is it LATIN1?
> How can I figure it out? And can I change it to UTF8?

The hex sequences are consistent with ISO-8859-1 (aka latin1).
You may want to check out mbstring, iconv or recode:

<http://se.php.net/manual/en/refs.international.php>


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux