List Info

Thread: RE: Query2XML & utf8 databases




RE: Query2XML & utf8 databases
user name
2007-04-10 17:10:35
Hi Mickaël!

Please CC all mails to pear-devlists.php.net

Mickaël Guérin wrote:
> 
> Hi Lucas,
> 
> I'm a user of Query2XML and I'm experiencing some 
> difficulties : there's
> no way to tell Query2XML if datas need to be
'utf8_encoded' or not.
> Is it on your TODO list ?

If I'm understanding you correctly, you mean that the data
in your database
already is UTF-8-encoded and therefore
XML_Query2XML::_utf8encode() should
not be called.
There are two solutions to this problem (that all require a
new release):
1) make XML_Query2XML::_utf8encode() protected (instead of
private) so that
it can be overwritten by sub-classes; this is OO style
2) create a new option named 'encoder' that can be specified
on every level
and allows you to overwrite the default of
XML_Query2XML::_utf8encode() -
this would work like $options['mapper'] [1]

I prefer the second solution as it gives the developer the
possibility to
use different encoding functions for different levels, i.e.
for different
tables. What's your opinion?

This has been sitting on my todo-list for quite some time
now; so thanks for
bringing it up!

> 
> I've looked at the code, and the only consequence of 
> implementing such a
> feature would be to remove the 'static' attribute of
some methods.
> Let me know if you plan to implement this, else I would
patch 
> Query2XML
> (and send you a patch of course ;) ).
> 
> Mickaël.
> 

Cheers,
Lukas

[1]
http://query2xml.sf.net/docs/html/XM
L_Query2XML/tutorial_XML_Query2XML.pkg.h
tml#query2xml_getxml.options_mapper

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )