Doesn't it mean that UFF5E maps to \xA2\xB2 in euc-jp?
2. What's the best practice in develop application in multi-encoding
environment, like web+db+xml applications?
It'd make me a mess while developing in such enviroment that:
TT Template is written in euc-jp or utf-8
one data is fetched via XML (RSS) in utf-8 or euc-jp
another data is stored to and fetched from MySQL in utf-8
HTTP requests come from mobile phones in Shift_JIS
Concatinating non-Unicode strings with Unicode strings raise UTF-8 Auto
Upgrading and thus raw UTF-8 Strings get corrupted.
For example at least, how do I tell Template-Toolkit that template is
written in euc-jp? It calls open() in its own modules, so binmode or
encoding.pm, unless you open template files and pass its filehandle
explicitly, which is not the case of mine.
I tend to think there should be encoding layers to all
data-stream-handling modules like DBI, Template-Toolkit, CGI.pm (or
Apache::Request) etc. Am I thinking right here?
Now I'm working on a module called "WWW::GooglishQuery" that parses Googlish query parameters like
XML url:foobar.com title:-"XSLT"
and packs it into appropriate data structure. What's the best API for it? Maybe something like this:
use WWW::GooglishQuery; use CGI;
my $query = CGI->new(); my $text = $query->param('q');
my $q = WWW::GooglishQuery->new(); $q->parse_query($text);
Then, how do I extract query parameters? Currently I think of returning query as hashref, that is fully compatible with SQL::Abstract module. Then we can search database with Class::DBI::AbstractSearch by passing that hashref.