Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UTF-8, still using HTML entities in navigation markup output?
#6
ccagle8 Wrote:Ive checked this out, and I fail to see where the problem is. From the source, you may see the encoded characters, but why is this a bad thing?
...
Code:
German ÄäÖöÜü

It makes a lot of operations on the page a bit more difficult, e.g.
  • Extracting the words for search - you have to decode the entities first
  • Extracting the first n characters for an excerpt - the number of characters will be off, if you don't decode
  • Splitting a long page into multiple pages.

Together with these terrible slashes I had to get the content for I18N Search like (it works, but it is correct?):

Code:
$content = html_entity_decode(strip_tags(stripslashes(htmlspecialchars_decode($pagedata->content))), ENT_QUOTES, 'UTF-8')

I think, it's impossible to get the page content with tags, but everything besides htmlspecialchars decoded - thus the pagify plugin doesn't care.

BTW: I hope the person responsible for add/stripslashes and it's "automagical" usage is never allowed to define a functionality of a programming language again ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
UTF-8, still using HTML entities in navigation markup output? - by mvlcek - 2011-03-13, 18:19:09



Users browsing this thread: 1 Guest(s)