... Settings of fromcode and tocode and their permitted combinations are implementation-dependent. Valid values are specified in the system documentation [i.e. on each particular system]...
retval() returns the return value of the underlying iconv() function for the last conversion; according to the Single UNIX Specification, this value indicates "the number of non-identical conversions performed." Note, however, that iconv implementations vary widely in the interpretation of this specification...
get_attr(): This method is only available with GNU libiconv, otherwise it throws an exception...
I've had only passing acquaintance with iconv, and that was a few years ago, but based on those passages, it seems that if you decide to use Text::Iconv, you're asking for non-portability. The standard perl Encode module and PerlIO don't seem to have issues of that sort, from what I've seen so far.
(I'm guessing that the problem with iconv might be the presence of several competing implementations -- despite the term "Single UNIX" in its description -- kind of like all the different versions of the "standard" ps utility.)
As for the problem you're having with that code snippet... Why are you converting from utf8 to utf8? Could you try using the script in this node -- tlu -- TransLiterate Unicode -- to look at your code/data, and re-post with the actual unicode codepoint hex values for the characters in question? The character sequences in the OP (when I looked at it) seemed like corrupt data, not interpretable as utf8.
If you don't have a firm, explainable reason why you must use Text::Iconv, I would suggest that you avoid using it. Perhaps tell us more about what processing problem you are trying to solve -- there's bound to be a better way to do it.
(updated to replace unintended "link" with proper square brackets in quoted docs)
In reply to Re: Text::Iconv module usage
by graff
in thread Text::Iconv module usage
by daptal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |