Jump to content

Problems with ä, ö & other


Mudsaf

Recommended Posts

Im wondering why i see at my localhost letters like ä and ö, but when i go to my online page it writes like. Is there some config that should be done in php.ini or what? Any suggestions. Charset: charset=iso-8859-1 Ä = Ä

Link to comment
Share on other sites

Use UTF-8... everywhere... encoding, charset... if there's a way to alter it, alter it.This includes file encoding, HTTP header, meta element... if you have database, the connection charset, the db charset, and the table collation.Once you have, and explicitly indicate, UTF-8, all characters should be outputted correctly.

Link to comment
Share on other sites

Well actually id like to keep it at iso-8859-1. But the main problem was SERVER 1 (Xampp)Shows them like they should be ä, ö ... etc SERVER 2 (PHP not 100% sure)Shows them like Ä = Ä Both has same files and xampp shows correctly. So should i change settings at PHP.ini or somewhere?

Edited by Mudsaf
Link to comment
Share on other sites

It looks as if, at some point, the data is being converted to UTF-8. Is this data coming from the database? If there isn't a better way to find out where this is happening, you can use PHP's utf8_decode() function. I'd rather find out where the conversion is happening and solve the problem from the root.

Link to comment
Share on other sites

Yes data is coming at database collation = emptytried collation = utf-8 general ci still no difference. at every page start there is the code below under <head> tag.<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Edited by Mudsaf
Link to comment
Share on other sites

No effect when changed meta to utf-8. Text isn't htmlspecial coded in database so its like "TÄMÄ" <-- for example whitout quotes.

Link to comment
Share on other sites

had htmlspecialchars_decode, but removed and ä turned to ? inside <> with reversed vertically. UTF-8 decode just makes ä to ? Kind a fixed, but would still be good if it would automaticly. Turned coding from browser to ISO from utf-8 and now it says Ä & Ö.

Edited by Mudsaf
Link to comment
Share on other sites

Well actually id like to keep it at iso-8859-1.
1. Why?2. If you insist... specify that charset everywhere. Encode your files as "ANSI", use it as a header, meta, db collation, etc.The point is to specify the same thing everywhere, not to mix things. Also, if you use htmlspecialchars(), html_entity_decode() or another similar function, you should specify the charset parameter there to the charset of the input.
Link to comment
Share on other sites

Okay its UTF-8 now on php page, MySQL table = utf-8 general ci. Still no difference data taken from database with SELECT + $row['Column'] not decoded.

Link to comment
Share on other sites

Still having some problems when data comes from MySQL database... if i change page coding to UTF-8 from ANSI navigation goes like crazy, but now textarea is going crazy.

Link to comment
Share on other sites

BBKAWKAKRAWR now textarea is good, but the navigation is fked T_T There must be problem in PHP or MySQL server since xampp shows it now correctly, but other server shows it like mess.

Edited by Mudsaf
Link to comment
Share on other sites

Well the problem isn't at convering since i got 2 servers BOTH has same files >Server 1 = Xampp [Works Like Charm]>Server 2 = PHP Server with MySQL [Problems]

Link to comment
Share on other sites

No errors when display_errors = On Really this is bit confusing T_T, bit fixed when ie settings changed still text = messed at textarea. Hmm

$text = mb_convert_encoding($row['Teksti'], 'UTF-8', "ISO-8859-1");

result = ä Looks clear in Xampp server but not in PHP T_T

Edited by Mudsaf
Link to comment
Share on other sites

If it's working in one server and not in another then you'll need to look for differences. That may mean checking PHP settings, MySQL settings, and checking the headers that the server returns.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...