On 8 Aug 2004, at 17:35, David Wheeler wrote:
On Aug 8, 2004, at 9:14 AM, Matt Sergeant wrote:
i.e. for every fetch call, you need to do:
SvUTF8_off(AvARRAY(av)[i]);
Now, people using your DBD can decide to upgrade the variable if they wish to, but most people who don't need to will be unaffected.
I think that this is fine as long as there's an easy way to upgrade the variable. I could use Encode::_utf8_on(), but that seems like more overhead than is necessary unless I've loaded Encode for some other use already. Perhaps there could be a module or even a DBI method that does the equivalent?
# Psudeocode; sub utf8_on { SvUTF8_on($_[0]) }
Certainly fairly easy to export that from the DBI.
Tim and I talked about long term plans for this, where the user might specify in advance which columns he'd like UTF-8 turned on for, or some (I thought horrible) heuristic method where the DBD automagically decides to turn on the flag if it detects data that it can turn into UTF-8 - but that sounds like a world of pain to me.
Better IMHO would be an extension to bind_col - it should be trivial to add an attribute in there. The downside being that not many people use bind_col.
Matt.