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 7517291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:23:55+00:00 2026-05-30T01:23:55+00:00

I am running Active Perl 5.14 on Windows 7. I am trying to write

  • 0

I am running Active Perl 5.14 on Windows 7.
I am trying to write a program that will read-in a conversion table, then work on a file and replace certain patterns by other patterns – all of the above in Unicode (UTF-8). Here is the beginning of the program:

#!/usr/local/bin/perl
# Load a conversion table from CONVTABLE to %ConvTable.
# Then find matches in a file and convert them.
use strict;
use warnings;
use Encode;
use 5.014;
use utf8;
use autodie; 
use warnings    qw< FATAL  utf8     >;
use open        qw< :std  :utf8     >;
use charnames   qw< :full >;
use feature     qw< unicode_strings >;

my ($i,$j,$InputFile, $OutputFile,$word,$from,$to,$linetoprint);
my (@line, @lineout); 
my %ConvTable;    # Conversion hash
print 'Conversion table: opening file: E:\My Documents\Perl\Conversion table.txt'."\n";
my $sta= open (CONVTABLE, "<:encoding(utf8)", 'E:\My Documents\Perl\Conversion table.txt');
binmode STDOUT, ':utf8';    # output should be in UTF-8
# Load conversion hash
while (<CONVTABLE>) {
    chomp;
    print "$_\n"; # etc ...
# etc ...

It turns out that at this point, it says:

wide character in print at (eval 155)E:/Active Perl/lib/Perl5DB.pl:640]line 2, <CONVTABLE> line 1, etc...

Why is that? I think I’ve gone through and implemented all the necessary prescriptions for correct handling of Unicode strings, decoding and encoding into UTF-8?
And how to fix it?

TIA

Helen

  • 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-30T01:23:56+00:00Added an answer on May 30, 2026 at 1:23 am

    The Perl debugger has its own output handle that is distinct from STDOUT (although it may ultimately go to the same place as STDOUT). You’ll also want to do something like this near the beginning of your script:

    binmode $DB::OUT, ':utf8' if $DB::OUT;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a web application that is running against Windows Authentication using our Active
I have a Java application that authenticates against Active Directory. When running the program
I cannot get in-place editing Perl one-liners running under ActivePerl to work unless I
I have a Perl/POE/Tk script running on Win32 ActivePerl that calls executables using system
I have Apache/SVN running on Windows Server 2003 with authentication via LDAP/Active Directory and
I am running a test Active directory and am trying to query with ldap.
I have a Perl script that I'd like to run on Windows, using either
I'm writing a daemon for a newsletter in Perl. The daemon will be running
I just installed Active state's komodo edit on my Windows. It's running fine but
I'm a Perl newbie. I'm trying to learn based on a previous person's work

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.