• skip to sidebar
  • skip to search box

trainedmonkey

by Jim Winstead Jr.

July, 25, 2003 archives

spy kids 3d

this msnbc article about spy kids 3d mentions that they'll be handing out red-and-blue glasses. i guess it isn't feasible to do a wide release of such a film that uses polarized lenses, even though it could be full-color that way. (or does the red-blue technique yield color pictures, too?)

back when i worked at knowledge adventure, we built a small site showcasing anaglyphic images from older products, sources we found over the internet, and some that our artists made for kicks. one of the several sites i should have archived. (here's another.)

oh, and how it pains me to see where that adventure.com link goes now. these were the days.

» Friday, July 25, 2003 @ 12:30am » 3 comments, add yours

xml handling in php4

given xml input as a string with a xml declaration that specifies the encoding, what can i do to always get back utf-8 data in my character data handler?

that is, how do i get "i ♥ são paulo" as utf-8 given either of these two inputs:

<?xml version="1.0" encoding="iso-8859-1"?>
<foo>i &#9829; são paulo</foo>
<?xml version="1.0"?>
<foo>i &#9829; s&#227;o paulo</foo>

handling the second case is easy, it is the first case that i can't figure out.

and someone deserves a kick in the teeth for making php4's xml parser default to iso-8859-1.

» Friday, July 25, 2003 @ 6:17pm » 3 comments, add yours

xml handling in php4: solved

so my problem with the xml handling in php4 had a two-step solution: set the encoding on the parser object based on the xml declaration (or utf-8 by default), and set the target encoding so that utf-8 encoding is sent to the character data handler. (thanks to adam for making me take another look at the target encoding thing—i had just assumed it had something to do with outputting xml using the xml extension. i had tried setting the encoding on the parser object before, but that changes both the input and target encodings by default.)

looking at the cvs logs, the misfeature of setting the encoding to iso-8859-1 by default can be worked around in php5 by setting an encoding of "", which lets expat behave as the xml specification intended. (default to utf-8, and honor the encoding the xml declaration.)

» Saturday, July 26, 2003 @ 12:13pm » Comment
« Tuesday, July 22, 2003 • Saturday, July 26, 2003 »
  • Home
  • About
  • Archive
  • Bookmarks
  • Photos
  • Projects
  • GitHub
  • @jimw@mefi.social

Dedicated to the public domain by Jim Winstead Jr.