Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7548289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:39:39+00:00 2026-05-30T09:39:39+00:00

What could here be wrong: I get the error-message new: Unicode string must be

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:39:40+00:00Added an answer on May 30, 2026 at 9:39 am

    Unicode::GCString suffers from the Unicode Bug (assigns meaning to the UTF8 flag):

     $ perl -MUnicode::GCString -E'
        $_=chr(0xE9);
        utf8::downgrade($_);
        Unicode::GCString->new($_);
        say "ok";
     '
     new: Unicode string must be given. at -e line 4.
    
     $ perl -MUnicode::GCString -E'
        $_=chr(0xE9);
        utf8::upgrade($_);
        Unicode::GCString->new($_);
        say "ok";
     '
     ok
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is some code I could not get to format properly in markdown, this
I get this error message while compiling: Assembly 'MyFramework [...]' uses 'System.Web.Extensions, Version=3.5.0.0 [...]'
Since Embarcadero's NNTP server stopped responding since yesterday, I figured I could ask here:
The only instructions I could find are here: http://eigenclass.org/hiki/fast-widefinder and on the old jocaml
Could somebody please explain to me what happens here? I am creating a binding
Could someone please help me in here, I'm just a beginner who want to
What could cause this? Here's the stack trace: #0 0x0645c0f5 in std::_Rb_tree_increment (__x=0x83ee5b0) at
Click here to see what I mean.. What could prevent these two from sitting
I searched through here as best I could and though I found some relevant
I have a piece of code here that i really could use some help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.