Problem with "ë" letter in the table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MicroBoy
Forum Contributor
Posts: 112
Joined: Sat Mar 14, 2009 5:16 pm

Problem with "ë" letter in the table

Post by MicroBoy »

My language has a letter tha is ë, and in the table it shows like a symbol. But just at the date not at other columns. When I go to phpMyAdmin everything it's ok with the date, the letter ë is there. Look these 2 photos:

Image
Image

p.s. I don't know why in database at the Emri and Lajmi the letter ë is A<, Now I saw for the first time, but that's not a problem for me because in the webpage is ë.
sujithtomy
Forum Commoner
Posts: 46
Joined: Tue Mar 24, 2009 4:43 am

Re: Problem with "ë" letter in the table

Post by sujithtomy »

Hello,

Are you using UTF-8 Char set ??


Regards,
Sujith
MicroBoy
Forum Contributor
Posts: 112
Joined: Sat Mar 14, 2009 5:16 pm

Re: Problem with "ë" letter in the table

Post by MicroBoy »

sujithtomy wrote:Hello,

Are you using UTF-8 Char set ??


Regards,
Sujith
Where do you mean to use it, in database or in .php file?
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: Problem with "ë" letter in the table

Post by panic! »

In the database. With PHPMyAdmin looks like thats what you're using.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: Problem with "ë" letter in the table

Post by William »

You need to make sure that the database is using UTF-8 charset, you're sending headers that your website is using UTF-8 and you make sure that all incoming input into the database is UTF-8. I'm guessing that somewhere something inserted the data wrong in your database.
MicroBoy
Forum Contributor
Posts: 112
Joined: Sat Mar 14, 2009 5:16 pm

Re: Problem with "ë" letter in the table

Post by MicroBoy »

In phpmyadmin I made "Collation: utf8_bin" again it's the same thing. William i'm thinking like you, meaby the problem is that the date is written into database by this function:

Code: Select all

setlocale(LC_ALL, 'albanian');
$time = strftime("%A %d %B %Y, %H:%M");
Emri and lajmi are always written by the user, they aren't added automatically like the date.
William wrote:and you make sure that all incoming input into the database is UTF-8
How to do that?
sujithtomy
Forum Commoner
Posts: 46
Joined: Tue Mar 24, 2009 4:43 am

Re: Problem with "ë" letter in the table

Post by sujithtomy »

Hello,

utf-8 char set in database.

Regards,
Sujith
MicroBoy
Forum Contributor
Posts: 112
Joined: Sat Mar 14, 2009 5:16 pm

Re: Problem with "ë" letter in the table

Post by MicroBoy »

Now when I use mysql_set_charset('utf8'); in the read page is happening like in the photo (the letter ë in the date it's ok but the letter ë in emri and lajmi are showing as A):
http://img220.imageshack.us/my.php?image=70648566.jpg
-----------------------------------------------------------------
When I use mysql_set_charset('utf8'); in the add page is happening like in the photo (the letter ë in the emri and lajmi are ok but the letter ë in date is showing as ?):
http://img205.imageshack.us/my.php?image=80456805.jpg

p.s. add page is the page I use to add news, the read page is the page that I use to show news in table.
Post Reply