Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problems with Polish letters
doodlebug
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 16.09.2010

Ostrzeżenie: (0%)
-----


Hello All!
Apologies for my lack of Polish and apologies if this has gone in the wrong forum.
I'm creating a website where you enter your details in text boxes on an .html page, which you then review on a .php page.
Everything has been changed to utf-8.

The problem is when you enter Polish characters in the text box, on the next page when you review the information and say whether it's good or not, the Polish characters show up as "Auml�Auml�Auml�Aring�"

Any idea what the problem could be?

Many thanks in advance
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dariuszp
post
Post #2





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 9.09.2010

Ostrzeżenie: (0%)
-----


Hi,
first of all, use preg_replace because ereg is deprecated. Second, you should use htmlspecialchars instead of htmlentities i think. Last thing, check meta tag on the webpage if you have utf-8 encoding. After that check if you have utf-8 in your database. You receive ? because web browser don't know what to do with additional byte.

You should know that iso-8859-2 (latin2) use 1 byte to encode a character. UTF-8 need 1 byte for first 128 characters (ASCII), then 2 bytes after that.
When you display utf-8 string as latin2, all characters above US-ASCII table are displayed wrong because it display each of the two bytes separately and not as one char.

Ten post edytował dariuszp 17.09.2010, 13:28:11
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 27.12.2025 - 22:45