Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: replacing special characters in file

by Joost (Canon)
on Aug 05, 2005 at 10:28 UTC ( [id://481170]=note: print w/replies, xml ) Need Help??


in reply to replacing special characters in file

Perl used to only allow ASCII in identifiers, if you use you can "use utf8" in recent perls to indicate that you want to be able to use unicode identifiers.

String literals in perl can be in any encoding, but how they will look in your editor is dependent on the editor (and possibly on markings in the file). Most modern editors support UTF-8 unicode encoding, and I'd guess that most win32 editors support the win32 specific encodings too.

Input & output can be in many encodings, but in most cases, you need to specify what encoding you're going to use.

See perluniintro, binmode, utf8 and Encode.

  • Comment on Re: replacing special characters in file

Replies are listed 'Best First'.
Re^2: replacing special characters in file
by xdg (Monsignor) on Aug 05, 2005 at 12:13 UTC

    I think Joost and polypompholyx are on the right track for the answer to this question, but it sounds like the OP is wrestling with character set challenges beyond just Perl, based on the description of "cutting/pasting" and "previewing". In essence, one needs Excel, the text editor, and the console (if that's where things are being printed) to all be "speaking" the same character encoding (and have a font that supports it, too) -- or at least one needs to take into account the differences between all these variables. Even if one gets the encodings right in Perl, the results could still look strange when viewed in some other program (console or editor). The OP will need to do more research into the unicode/character-code support of all the other links in the chain.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://481170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-24 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found