Re: submit data from php: error with special character in the posted text

From: Ivo Rossacher <rossacher(at)bluewin(dot)ch>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: submit data from php: error with special character in the posted text
Date: 2005-03-21 20:56:54
Message-ID: 200503212156.54363.rossacher@bluewin.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

The encoding of the database and the client are not compatible. First of all
you need to select a database encoding which supports all the characters you
require (for example: createdb -EUNICODE testdb). I would recommend unicode
because it can store all possible characters and can be converted in any
client encoding by the server.
If your client does not support the utf8 encoding (this is the internal
representation of unicode in the database) you can specify the correct
encoding for the client by a sql statement (for example: SET
client_encoding=LATIN1;). show client_encoding will display the current
settings. The server will convert then all characters to and from this
encoding for this client. This conversion will increase the load on the
server side. So for high trafic sites it might be an issue to consider.

Best regards
Ivo

Am Donnerstag, 17. März 2005 15:33 schrieb Luciano Naldesi:
> I am using an open source sw for a test forum, but if I insert in my
> message some special character like à,è,ì ... when I submit the topic I get
> the following error message:
> Error in posting
> DEBUG MODE
> UPDATE elca2Forum_posts_text SET post_text = 'la città', bbcode_uid =
> '04e1371840', post_subject = 'prova accentate' WHERE post_id = 14
> Line : 282
> File : functions_post.php
>
> The message are inserted/updated in a posgresql db.
> Any suggestion?
> thanks luciano

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jani Averbach 2005-03-21 21:49:40 pg_dump, custom format and changes in the dump file
Previous Message Steve Crawford 2005-03-21 20:35:22 Re: Excessive growth of pg_attribute and other system tables