in reply to Re: writing utf8 files under WindowsXP
in thread writing utf8 files under WindowsXP

Sorry for my ignorance: I tried your suggestion:
while (<IN>) {from_to($_,"cp1250", "utf8"); print OUT $_;}
but it complains about from_to, and I do have "use Encode" at the top of the script. What else does from_to need? Thanks

Replies are listed 'Best First'.
Re: Re: Re: writing utf8 files under WindowsXP
by graff (Chancellor) on Apr 29, 2004 at 04:21 UTC
    You need to use Encode like this:
    use Encode qw/from_to/; ... from_to( $_, "cp1250", "utf8" ); ...
    Alternatively, you could use it like this:
    use Encode; ... Encode::from_to( $_, "cp1250", "utf8" ); ...
    This is because by default, Encode does not export the "from_to" function into the "main" namespace of your script.
      Thanks a lot to all for your help. Now I got my script working.