Sounds like you're getting tripped up by the fact that Windows and the cmd.exe shell use different code pages. D:\pscrpt>perl -e "print ord('£')"
163
D:\pscrpt>perl -e "print chr(156)"
£
D:\pscrpt>perl -e "print chr(163)"
ú
You need to convert between "cp1252" and "cp850" - for which you can use either Text::Iconv or (I believe) the Encode module. The latter, being a core module, is probably the "recommended" approach, though I've personally only ever used Text::Iconv.
Cheers, Rob | [reply] [d/l] |
By using chr function you can do that.
print chr(156);
This will print '£' in the Command prompt in Windows. You would have used 163 instead of 156 which prints '£' in ascii file but in command Prompt you would have got accented u. So use 156 here for Command Prompt Output.
| [reply] [d/l] |