![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: Feb 2007
Posts: 36
Thanks: 7
Thanked 0 Times in 0 Posts
![]() |
PHP does not show special characters
Hi,
Please help me to solve this special characters problem using PHP (php-5.1.6-3.el4s1.9): Code: <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> </head> <body> <?php print"áàäâa" ?> </body> </html> Output: □ Note how it is a single block, neither the "a" is showed. I tried also: <?php header(Content-Type: application/html; charset=UTF-8) print"áàäâa" ?> But the browsers ask for an application to open the result. Kind Regards, Rocko |
|
|
|
|
|
PM User | #2 |
|
Regular Coder ![]() Join Date: Nov 2007
Location: Leeds, UK
Posts: 455
Thanks: 16
Thanked 15 Times in 15 Posts
![]() |
this is HTML
HTML can not display special characters like that you have to use the HTML Code or use htmlentities(); E.G PHP Code:
Use this html_entity_decode(); |
|
|
|
| Users who have thanked barkermn01 for this post: | Rocko (07-03-2008) |
|
|
PM User | #3 |
|
Regular Coder ![]() Join Date: May 2006
Location: Wales
Posts: 806
Thanks: 1
Thanked 77 Times in 74 Posts
![]() |
UTF-8 doesn't support those kind of characters, you'd need to use a different character encoding (like below). The content-type of HTML pages is text/html not application/html which is why it was probably causing problems.
PHP Code:
__________________
|
|
|
|
| Users who have thanked Mwnciau for this post: | Rocko (07-03-2008) |
|
|
PM User | #4 | |
|
Regular Coder ![]() Join Date: Nov 2007
Location: Leeds, UK
Posts: 455
Thanks: 16
Thanked 15 Times in 15 Posts
![]() |
Quote:
|
|
|
|
|
|
|
PM User | #5 |
|
New Coder ![]() Join Date: Feb 2007
Posts: 36
Thanks: 7
Thanked 0 Times in 0 Posts
![]() |
Thank you.
Both options worked fine: PHP Code:
CodingForums.com > :: Client side development > XML Why using UTF-8? |
|
|
|
|
|
PM User | #6 |
|
Regular Coder ![]() Join Date: Nov 2007
Location: Leeds, UK
Posts: 455
Thanks: 16
Thanked 15 Times in 15 Posts
![]() |
if you are using php dont send a header
unless you are using langs like japaneis (sorry for spelling) you dont need to UTF-8 is the standerd HTML encoding you can use ANCI but not with php codes that use headers coz ANCI sends hiden text and there for a header is sent |
|
|
|
| Users who have thanked barkermn01 for this post: | Rocko (07-04-2008) |
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|