in reply to Re: Converting UTF8 to ANSI
in thread Converting UTF8 to ANSI

by "ANSI" I assume you mean Windows-1252.

To find out a machine's actual "ANSI" encoding, you can use the following:

use Win32 qw( ); my $ansi_enc = "cp".Win32::GetACP();

Replies are listed 'Best First'.
Re^3: Converting UTF8 to ANSI
by Your Mother (Archbishop) on Aug 29, 2017 at 18:11 UTC

    Excellent tip. FWIW, I had to update to use it.

    PS C:\Users\moo> perl -MWin32 -E 'say Win32::GetACP()' Undefined subroutine &Win32::GetACP called at -e line 1. PS C:\Users\moo> cpanm Win32 --> Working on Win32 Fetching http://www.cpan.org/authors/id/J/JD/JDB/Win32-0.52.tar.gz ... + O Configuring Win32-0.52 ... OK Building and testing Win32-0.52 ... OK Successfully installed Win32-0.52 (upgraded from 0.44) 1 distribution installed PS C:\Users\moo> perl -MWin32 -E 'say Win32::GetACP()' 1252
Re^3: Converting UTF8 to ANSI
by palkia (Monk) on Aug 29, 2017 at 18:05 UTC
    Thank you.
    I didn't even know a machine can have, an actual vs other, ANSI encoding.
    I'll look in to it as soon as I can.