Help for this page

Select Code to Download


  1. or download this
    use Encode;
    use DBI;  # (or whatever you use for your PostgreSQL)
    ...
    my $latin1str = encode( 'iso-8859-1', $unistr );
    
    print $latin1str;
    
  2. or download this
    # snippet to convert utf8 to latin1 -- NB: only works for utf8
    # characters that correlate to unicode \x{0000} - \x{00ff}
    ...
    }
    
    # now $_ holds latin1 (single-byte, iso-8859-1) characters