Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Searching for "utf8" yields a ton of results. Sorting through the correct method to do something is a bit daunting. I've tried several solutions to, what I think is a simple problem, with no luck.

I have a perl program that opens a text file, stores all the data in a hash, and spits out a new text file. This file has UTF8 characters in it. Basically, all i want to do is preserve these characters.

Currently what happens when i open my output file in a UTF8 aware text editor it displays a "?" on the UTF8 characters that perl output. If i save the file as UTF8 from the text editor the characters appear correctly.

My question is, how do i skip that step? How do i make perl correctly read in UTF8 then output everything to a UTF8 file?

Replies are listed 'Best First'.
Re: UTF8 Modules everywhere, which to use?
by Anonymous Monk on Feb 09, 2006 at 16:45 UTC
    I think i found my answer seconds after posting:
    binmode FILE, ":encoding(utf8)";