in reply to Unidecode fails printing french accents
#! /usr/bin/perl use warnings; use strict; use utf8; use Text::Unidecode; my $input = 'Montréal Centre-ville'; print unidecode($input); __END__ Output: Montreal Centre-ville
If you're reading the input from a file, you don't need utf8. Instead, you should specify the encoding of the file:
open my $IN, '<:encoding(UTF-8)', 'input.txt' or die $!;
Update: You should consider editing the title. Unidecode fails recognising the accents, it wouldn't print them even if it worked.
|
|---|