Problem with encoding

Reply

Join Date: Oct 2008
Posts: 2
Reputation: nati123 is an unknown quantity at this point 
Solved Threads: 0
nati123 nati123 is offline Offline
Newbie Poster

Problem with encoding

 
0
  #1
Oct 5th, 2008
Hello,

I have a problem with displaying special slovenian letters.

1) I set up in MySQL database charset to utf8, and collate to ut8_general_ci.

2) In my php files which communicate to database, I put next code:

mysql_query('SET CHARACTER SET utf8', $db);
mysql_query('SET NAMES utf8', $db);

mysql_connect is stored in $db.

3) I use phpedit for editing my php files and I set charset to EastEuropean to be able to type special slovenian letters.

4) And finally, I put next code at the beggining of my php files:

header("Content-Type: text/html; charset=utf-8");

Now, I have 2 results, depending on Internet Explorer encoding. If encoding is UTF8, I can see special letters in data retreived from database properly, but in ordinary text on page I'm getting questionmarks instead of special letters.
When I put Central European encoding in IE, situation is opposite, ordinary text is ok, but data retrieved from database have wierd symbols.

Whatever I tried, I could't get everything displayed properly.

Anyone can help, please?

Tnx in advance,
Nati
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,614
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 131
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: Problem with encoding

 
0
  #2
Oct 7th, 2008
You need to set the charset in your editor to UTF-8, not East European. Remember that unicode supports all characters, so those special slovanian letters should still work.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2
Reputation: nati123 is an unknown quantity at this point 
Solved Threads: 0
nati123 nati123 is offline Offline
Newbie Poster

Re: Problem with encoding

 
0
  #3
Oct 7th, 2008
Hello,

I'm using PHP Edit which has no option to set charset to UTF8. Obviously I need some other editor, do you have any suggestion? For free one


Regards,
Nati
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,614
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 131
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: Problem with encoding

 
0
  #4
Oct 7th, 2008
Try geany (avaliable for windows and linux). Don't know if it has as much features as PHP edit, but it has syntax highlighting, tabs, and auto-tabbing which is good enough for me.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 536 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC