UTF-8 Latin 1 etc... I moved to linux and nothing seems to work properly |
[eluser]snaggy[/eluser]
This is a problem I hadn't encountered in windows, in my pages written in italian with italian special characters such as òàùèì that show up as question marks... I don't know if I should use UTF-8 or Latin 1, can you suggest me which one should I use (easiest one)? I have a database in MySQL in which I can choose the collation... what to pick? In codeigniter my php files are encoded as UTF-8 I think, this is what Zend creates when I make a new file. In my view files charset can be set to either UTF-8 or ISO-8859-1 The point is that with every possible combination it doesn't seem to work. If I use Latin 1 as I did on windows firefox reads it as utf all the same, dunno why: Code: <html> even if the php files is encoded in latin 1 (does this matter?) I'm really confused, can anyone help or at least tell me what he/she does so that I can copy? thanks! Bye
[eluser]#1313[/eluser]
I work with cyrillic symbols. My database collation is UTF-8, my html charset is UTF-8, my files are stored in UTF-8 and my first query after connecting to database (i do it my models which work with database) is SET NAMES 'utf8';
[eluser]tobben[/eluser]
Also set the text encoding to UTF-8 in the text editor you are using. Using <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> on the webpage, but saving the file with UTF-8 encoding, or vice versa, would make æøå to som nasty looking chars.
[eluser]Crimp[/eluser]
The trick is to keep whatever you choose consistent throughout. http headers seem to be missing from what's been mentioned already.
[eluser]snaggy[/eluser]
Fantastic, the SET NAMES thing did the trick! By the way Crimp, if I add a header function with the content type, it gives an error saying that's already being passed by the parser,, but in the parser lib I can't find it. Does it matter? It's working all right right now thanks
[eluser]snaggy[/eluser]
I'm sorry but I got another problem!! I'm starting to feel hopeless... just about headers.. Code: A PHP Error was encountered What is this about! I'm not passing any header by the Parser (template) I think, I never used the header() function any idea? I tried to look at the code and I saw that the headers are passed for the coockies (session manager) and the redirect function (URL helper) bye
[eluser]Crimp[/eluser]
Set your default charset in the php.ini instead: http://www.usphp.com/ini.core.html Your errors usually happen when you echo something before loading the view. Check if you left some debugging echoes in your parser file.
[eluser]snaggy[/eluser]
No idea why, but if under linux i use the simplelogin library or anything that writes headers/coockies after having loaded the parser library it crashes... I decided to split it into 2 controllers and it works fine, but I would like to know why that happened nevertheless. bye! |
Welcome Guest, Not a member yet? Register Sign In |