in reply to Re^2: DBD::Oracle - Character Encoding Conversion
in thread DBD::Oracle - Character Encoding Conversion

As a matter of etiquette, it's considered appropriate to reply to those who reply to you. In addition to maintaining a thread of conversation, PerlMonks can be configured to send a message when someone replies to one of your nodes, so it makes it more likely that the original respondent can continue assisting.

Can you define manually? I've fixed corrupted files in the past using carefully crafted regular expressions, but that is usually not the right choice. Better would be using Encode to do transformations once you know how your input stream is formatted. Encode::Guess might be helpful there, though it has limited utility because it's such a messy problem. As some background, you should read through perluniintro if you haven't already.

TL;DR- What you are proposing is possible, but sounds a lot like nested band-aids.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re^3: DBD::Oracle - Character Encoding Conversion

Replies are listed 'Best First'.
Re^4: DBD::Oracle - Character Encoding Conversion
by Zygomax (Initiate) on Sep 28, 2015 at 12:51 UTC

    Pardon the breach of etiquette, I am new to these forums.

    By manually I meant explicitly. Here is the somewhat counter-intuitive code, where "$value" is from the hashref returned by a fetchall_hashref call:

    Encode::_utf8_off($value); $value = Encode::decode("utf8", $value);

    $value ends up being a Perl string with the utf8 flag on.

    Thanks!