What could here be wrong: I get the error-message
new: Unicode string must be given at ...
for the line
$gvalue = Unicode::GCString->new( $value );
use Unicode::GCString;
# ....
# ....
my $width = 0;
my $gvalue;
if ( $value ) {
$gvalue = Unicode::GCString->new( $value );
$width = $gvalue->columns();
}
# ....
# new: Unicode string must be given. at ...
$values comes form:
for my $i ( 0 .. $#$ref ) {
for my $j ( 0 .. $#{$ref->[$i]} ) {
my $value = $ref->[$i][$j] // '';
# ...
Until now while testing $ref is hardcoded in script but then it should become a module and $ref should be shifted in a routine.
Unicode::GCString suffers from the Unicode Bug (assigns meaning to the UTF8 flag):
It expects a string in stored using the UTF8=1 internal storage format. You can force the string to the right format using
utf8::upgrade, but it could also be a sign that you forgot to decode the string.