[FX.php List] Disabling conversion of UTF-8 to numeric character entities

Brion Vibber brion at pobox.com
Sat Jun 18 01:29:58 MDT 2005


I've noticed that FX is converting non-ASCII UTF-8 characters in 
FileMaker output into HTML/XML-style numeric character references. For 
instance this text in one of my records:

   In this usage, “base shear” is actually the “design base shear.”

comes out looking like this:

   In this usage, “base shear” is actually the “design 
base shear.”

For some stuff where I would be accepting such sequences in my output 
parser that works fine, but this is a bit problematic for me in other 
places.

It makes it hard to do safe HTML output of text field values, since 
htmlspecialchars() or htmlentities() will result in ugly double-escaped 
output. I can't use the text for anything non-HTML-ish either without 
doing a de-escaping run (which would also change any literal sequences 
in the source text, potentially corrupting data).

I've found I can disable this conversion and keep my text in proper 
UTF-8 by emptying out the conversion arrays after creating an FX object:

   $query = new FX( CORE_FMPRO_SERVER, $port, $servertype );
   $query->UTF8SpecialChars = array();
   $query->UTF8HTMLEntities = array();

But this is kind of a nasty hack, poking at internals which could 
change. It would be super if there was a clean public interface to 
indicate that I want the actual UTF-8 text.

-- brion vibber (brion @ pobox.com)


More information about the FX.php_List mailing list