Re: Issue when inserting Slovak characters in database via PHP code

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

 



The important steps:

1. display the form on utf-8 page:
	header('Content-Type: text/html; codepage=utf-8');
	... and the same in <meta> tag
2. use pg_set_client_encoding('UTF8') after connecting to posgres
3. have your database, tables and rows in UTF8 (you have already)
4. again, when retrieving, pg_set_client_encoding('UTF8')
5. display the form on utf-8 page

Alain Roger  wrote / napísal(a):
> Hi,
> 
> Sorry to cross post this mail but i'm not able to know from where comes my
> issue.
> I have a postgreSQL database in UNICODE (UTF-8 in v8.1.4 and UNICODE in
> v8.0.1).
> 
> Via my web application i type a sentence in Slovak language and it is
> stored
> into DB without any slovak characters. Instead of that, all particular
> characters are replace with \303\251 or \303\206 or \304\314 and so on...

perhaps the characters are stored as UTF-8, but you view them over ASCII
connection

> 
> I was thinking that issue was coming from DB encryption but on 2 different
> versions of DB (see above) i get the same result.
> after, i was thinking that it was coming from my web browser, but even if i
> setup character mode in central europe and Slovak language as default
> coding...nothing change...i tried on IE and Firefox.
> 
> Last step, i tried to type directly from my PhpPgAdmin (direct typing
> sentence there to DB), and i realize that when i click on save...the
> changes
> appear in DB aswritten above (e.g. : \303\251,...)
> 
> My latest test was to write via PhpPgAdmin (directly to DB) the UNICODE of
> slovak character contained within my sentence...so i used &#253, &#237 and
> so on...
> if i do that, those code are correctly saved into DB and when my PHP code
> show web pages, all sentences are correct.

these are html entities, they are different, they use only 7 bits. I
would not recomend on using them, you will use many capabilities.

-- 
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