problem with diacritics.

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
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

problem with diacritics.

Post by fabby »

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I don't know what it says, but i can't show in corect way the letter. The letter  ş it is shown asº and the lettert ţ is shown as  þ.

In the header i've put the code:
[syntax="html"]<meta http-equiv="Content-Type" content="text/html; charset=charset=UTF-8" />
and when i show from the database, i user:

Code: Select all

@mysql_query('SET NAMES utf8');
@mysql_query('SET CHARACTER SET utf8');
@mysql_query('SET COLLATION_CONNECTION="utf8_romanian_ci"');

Do you know what is the problem?
Thanks


scottayy | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
mrkite
Forum Contributor
Posts: 104
Joined: Tue Sep 11, 2007 4:19 am

Post by mrkite »

I personally have found that defining the character set in a meta tag isn't enough.

Instead I have to do this:

Code: Select all

<? header("Content-Type: text/html; charset=utf-8") ?>
You can check in firefox by rightclicking on the page, and selecting "View Page Info" it will say what firefox thinks the Encoding is.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

If that's actually your meta tag, then you've put "charset=" in there twice.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post by fabby »

ok. i did that but now that caracters are replaced with "?"
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

try using

Code: Select all

@mysql_query("SET character_set_connection = utf8");
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post by fabby »

nope, is not the solution. is all the same :(
do you have another?
But, for example in phpmyadmin, it is show's ok
And for example, i don'w know if you understand but here is: http://dexonline.ro/search.php?cuv=tap
it look ok.
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

are/did you use the same name/coalition/character set when you inserted the data to the database?
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post by fabby »

the data is inserted to the database...i taked the database from the internet.

Look the field tipe for the database:

Lexicon varchar(100) utf8_romanian_ci
HtmlRep text utf8_romanian_ci
Post Reply