Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-12-2009
Member
 
Join Date: Jun 2009
Posts: 3,859
Square instead of accents

I still have problem with the encoding of my website. All data emerging from a database are poorly encoded (output on the page). However, my page is in utf-8
HTML Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
And my table is also utf8_general_ci (not only the merging of the column, but also merging of the table). I therefore do not know how. Of course when I look at the data with phpMyAdmin they appear properly, so I think they are properly registered in the database.
Reply With Quote
  #2  
Old 04-12-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Square instead of accents

Even if you put the content-type, your file natively be little in another encoding, also write more in another php and verify that your file is utf-8. Also add a little header in php to put the content-type or make a ini_set('default_charset', 'utf-8');

My favorite is utf8_unicode_ci and utf8_general_ci

Also look how is your connection
Reply With Quote
  #3  
Old 04-12-2009
Member
 
Join Date: Jun 2009
Posts: 3,859
Re: Square instead of accents

Thank you for your reply. Listen I think the native file is good (raw data) precisely because the page has no problem with accents except what comes out of the database. For your last track I feel good how can I set the encoding format of the connection?

Apparently the problem is more complex. The table is in utf-8 and when I looked inside with phpMyAdmin which is appearing carefree. But in my web page they're square. According to me if I have a square it means that it is stored in ISO and so my page acts in the UTF-8.

How to rectify the error?
Reply With Quote
  #4  
Old 04-12-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Square instead of accents

Are you really sure that your page has a native encoding to utf8? Which editor do you use in your page? What is the extension in your query (mysql, mysqli, PDO?)

You could make utf8_decode or utf8_encode, but it'll be better if we did not do.

if you're in mysqli, you should make your connection type a query

$mysqli->query("SET NAMES UTF8" );
Reply With Quote
  #5  
Old 04-12-2009
Member
 
Join Date: Jun 2009
Posts: 3,859
Re: Square instead of accents

I use the plumeCMS CMS in which I created a special template. For editor I use notepad++, for the extension I think it is mysqli. Regarding the utf8_encode it does not work it will double the square. I think it is already in this kind of thing:

function Connection($user, $pwd, $alias='', $dbname, $pfx='', $debug=false, $version='4.0')
{
$this->error = '';
$this->con_id = @mysql_connect($alias, $user, $pwd);
$this->debug = $debug;
$this->pfx = $pfx;
$this->debug('* MYSQL CONNECT');
if (!$this->con_id) {
$this->setError();
} else {
$this->database($dbname);
}
if (strlen($version) and version_compare($version, '4.1', '>=')) {
$this->execute('SET NAMES \'utf8\'');
}
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Square instead of accents"
Thread Thread Starter Forum Replies Last Post
Need Spanish accents in Windows 7 Neel Kamal55 Operating Systems 3 04-12-2010 01:16 AM
Print Nx2 square table MaryJ Software Development 1 19-11-2010 10:16 PM
Texmaker removes all accents Aaliya Seth Windows Software 5 20-01-2010 02:31 PM
Blue Square in Icons GPK5050 Windows XP Support 3 22-10-2009 11:43 PM
Problem of accents in Java? Aarya Software Development 3 10-01-2009 01:16 PM


All times are GMT +5.5. The time now is 09:16 PM.