pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hans-Juergen Schoenig <postgres@cybertec.at>
To: Markus Bertheau <twanger@bluetwanger.de>
To: pgsql-php@postgresql.org
Subject: Re: Encoding issues
Date: Wed, 30 Apr 2003 10:04:23 +0200
Message-ID: <3EAF8387.1090509@cybertec.at> (raw)
In-Reply-To: <1051689089.2476.1.camel@saphir>
References: <3EAD0D1D.7010403@ecologic.de>
	<1051689089.2476.1.camel@saphir>

Markus Bertheau wrote:

>В Пнд, 28.04.2003, в 13:14, Dani Oderbolz пишет:
>  
>
>>Hi all,
>>
>>I have got a problem with the encoding of special caracters.
>>My DB uses the Encoding 'LATIN1'.
>>I modify data like this in psql:
>>
>>SET CLIENT_ENCODING = 'LATIN1';
>>update auftraggeber set name_de='Europäische Union';
>>    
>>
>
>Where specificially does the string "Europäische Union" come from? Is it
>input in a web form?
>
>  
>
>>When I access this in PHP (using this Query:
>>SET CLIENT_ENCODING = 'LATIN1';
>>select name_de from projekte.sel_auftraggeber;
>>
>>I get this:
>>
>>Europäische Union
>>    
>>
>
>This looks like UTF-8.
>
>  
>

try that one ...
we have used this as a basic workaround for some problems we had with 
encoding ...

-- converts any character set to any character set ...
CREATE OR REPLACE FUNCTION iconv(text, text, text) RETURNS text AS '
use Text::Iconv;

my $from = shift;
my $to = shift;
my $code = shift;

$converter = Text::Iconv->new($from, $to);
$converted = $converter->convert($code);

return $converted;

' LANGUAGE 'plperlu';

-- SELECT iconv('LATIN2', 'IBM437', 'Hallo Üü a');
-- SELECT pg_client_encoding(), iconv(pg_client_encoding(), 'IBM437', 
'Hallo Üü a');
SELECT iconv(pg_client_encoding(), 'IBM437', 'Hallo Üü a');


maybe this is useful ...

    Hans




view thread (3+ messages)

Message-ID: <3EAF8387.1090509@cybertec.at>
Permalink:  ../3EAF8387.1090509@cybertec.at/
Also on:    postgresql.org/message-id/3EAF8387.1090509@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: postgres@cybertec.at, twanger@bluetwanger.de
  Subject: Re: Encoding issues
  In-Reply-To: <3EAF8387.1090509@cybertec.at>
  References: <3EAD0D1D.7010403@ecologic.de> <1051689089.2476.1.camel@saphir> <3EAF8387.1090509@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox