Msg#: 4640470 posted 10:24 am on Jan 27, 2014 (gmt 0)
No idea why, but checked in phpmyadmin, and the swedish characters in that table were written that way. Other swedish letters in other tables are written well å, ä, ö. I edited the table and changed the characters so it works now.
Wonder if there can be more tables with characters like that. Is there a way to search the tables for these characters? Something like select * From all tables (or table) where all columns Like å
Msg#: 4640470 posted 4:50 pm on Jan 27, 2014 (gmt 0)
If I try to echo the output from the database using htmlspecialchars etc. the letters åäö etc converts to things like this:å What can I do about it?
Why do you want to do anything about it? Isn't that exactly what "htmlspecialchars" means? Replace each character with its named HTML entity. (Why someone would want to do this, since it makes your code unreadable, is a whole nother issue.)
There is probably an Official Source somewhere. But I've always used the trio of lists here [htmlhelp.com]. The ones used in Swedish-- and all other Western European languages-- are under "Latin-1 Entities".
Entities-- whether named or numerical-- are rarely needed today. But there was a time when browsers could only display characters that had named HTML 4 entities.
The pattern is &\w+; (ampersand, string of word characters, semicolon). Note that this includes essential entities such as — > and so on, so you need to make some exclusions before doing any global replace.
Msg#: 4640470 posted 6:22 pm on Jan 27, 2014 (gmt 0)
Lucy, It was an error, I had the html entities in the database, and when I tried to validate the output, they were showned just as they were in the database, instead of converting them to utf-8 as you can see in my second post.