Wide character in print at UL_VERTICA.pm line 951.

As i wrote in Re^5: Unrecognized ICU conversion error, this looks like a Unicode/UTF8 Problem.

Basically, Perl internally uses Unicode codepoints for characters, e.g. the "number" of a character can be greater than 255. Example:

#!/usr/bin/env perl use strict; use warnings; use utf8; use Encode; # Let's use the "Medium shade" block, Unicode point 0x2592 # https://www.unicode.org/charts/beta/nameslist/n_2580.html my $unicodechar = "\N{MEDIUM SHADE}"; print "Character code: ", ord($unicodechar), "\n"; print "Character: ", $unicodechar, "\n"; # "Wide character in print at + unicode_perlmonks.pl line 15." my $utf8 = encode('UTF-8', $unicodechar, Encode::FB_CROAK); print "Character as UTF8: ", $utf8, "\n";

In line 15, when you try to print the internal representation, problems happen. Basically, STDOUT expects valid 8-bit-per-byte characters, but you try to output too many bits for a single byte.

With proper encoding, in this case UTF8, you can turn the single character into a bytestream that encodes the character into multiple valid bytes. This isn't just splitting up the internal bytes, it is a "proper" encoding that works around multiple issues. Like, for example, preventing bytes that have the value of zero (so as not to mess up zero terminated string handling in C-like languages).

Tom Scott has a nice video on this if you are interested how this actually works: Characters, Symbols and the Unicode Miracle - Computerphile

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

In reply to Re^2: Unrecognized ICU conversion error by cavac
in thread Unrecognized ICU conversion error by Sainathuni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.