Perennially Sane

Reply to comment

Just in time!

She returned, and, as I said, I got to work on the problem of the Invisible Pink Unicode. Seriously, what with PHP's handling of character sets, that's what they should call it.

Turns out that - first - turning off the unicode character set in MySQL results will mean PHP stops trying to fit a single high-bit character into two ASCII slots. What character set is used instead, I have no idea. Typographical quotes are numbered 147 and 148; the single-character ellipsis (whose inventor needs to be beaten around the head with three periods) is 133 and so on. But at least we're now dealing with single characters, which are much easier to search for.

By running the string through a filter that looks up these values in a map (an "associative array"), I can turn these high-bit characters into more mundane ones - like three periods, a simple ", or a simple apostrophe.

By making these changes in the database, I save on runtime of the feed script as well.

I just managed to make the feed validate here for the first time in what must be a month or more. So I'm almost as happy about that as I am that Riverbend is okay.

--
Arancaytar

Reply

The content of this field is kept private and will not be shown publicly.
  • You may use these tags: [abbr], [acronym], [b], [center], [code], [color], [cpp], [css], [define], [diff], [dtd], [font], [h3], [h4], [h5], [h6], [hr], [html], [i], [img], [java], [javascript], [justify], [left], [list], [mysql], [node], [ol], [perl], [php], [python], [quote], [right], [s], [sh], [size], [sql], [sub], [sup], [table], [u], [ul], [url], [wikipedia], [xml]
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Easily link to terms in various wikis. For help, see <a href="/interwiki/3">interwiki</a>.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Powered by Drupal, an open source content management system

eXTReMe Tracker