Further to shmem's post above:
If it's just a question of translating text from single seventh-bit-set characters to some kind of pure-ASCII representation, it's possible to do this in one swell foop. The process of defining the translations can be a bit tedious, but it's done just once (update: and could even be done in a module for general inclusion). Note that in the code below, the German eszett/sharp-s "ß" translates to the "ss" ASCII letter pair. See also the possibly useful discussion of something like this for multi-byte Unicode sequences in the recent threads Read RegEx from file and particularly Re: Read RegEx from file.

use warnings; use strict; use Data::Dump qw(dd); my @acutes = qw(193 A 201 E 205 I 211 O 218 U 225 a 233 e 237 i + 243 o 250 u 221 Y 253 y); my @graves = qw(192 A 200 E 204 I 210 O 217 U 224 a 232 e 236 i + 242 o 249 u); my @others = qw(228 a 246 o 223 ss); my %xlate = (@acutes, @graves, @others); # dd \%xlate; # FOR DEBUG my ($search) = map qr{[$_]}xms, join '', map sprintf('\%03o', $_), keys %xlate ; # dd $search; # FOR DEBUG while (my $line = <DATA>) { chomp $line; $line =~ s{ ($search) }{$xlate{ord $1}}xmsg; die "non-ascii in '$line'" if $line =~ m{ [[^:ascii:]] }xms; print "'$line' \n"; } __DATA__ spanish: Depósito Centralízado french: voilà: a word with an accent gravè vanilla: this is plain ascii other: gräßliches Tröten
Output:
c:\@Work\Perl\monks\sylph001>perl xlate_to_ascii_1.pl 'spanish: Deposito Centralizado' 'french: voila: a word with an accent grave' 'vanilla: this is plain ascii' 'other: grassliches Troten'


Give a man a fish:  <%-{-{-{-<


In reply to Re^7: What's the 'M-' characters and how to filter/correct them? by AnomalousMonk
in thread What's the 'M-' characters and how to filter/correct them? by sylph001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.