Perl Unidecode modules - which to use (if not Text::Unidecode)?
L A Walsh
cygwin@tlinx.org
Sun Apr 4 20:22:47 GMT 2021
On 2021/04/01 13:35, Mark Aitchison wrote:
> 1. What perl Unicode modules should I consider, if not Text::Unidecode? The present need
> is to be able to convert those few "foreign" characters (like ÇĆĈĊçĉċĜĞĠĢĝģğġËÌÍÎÏÒÓÔÕ)
> that are basically ASCII with accent marks to their closest ASCII equivalents,
---
Hmm...have you tried installing from cpan?
I just tried it and it seems to work.
> cpan -i Text::Unidecode;
> > cat /tmp/in
ÇĆĈĊçĉċĜĞĠĢĝģğġËÌÍÎÏÒÓÔÕ
> cat /tmp/in| perl -e '
use Text::Unidecode;
while (<>) {
print unidecode($_);
}'
CCCCcccGGGGggggEIIIIOOOO
---
I.e. it stripped off all the accent marks. Is that what you
want?
(it spewed some warnings, but seemed to test out ok, so tried it).
put your characters in a file "/tmp/in", (i.e.
> cat /tmp/in
-- I know, not very creative,
but then:
cat /tmp/in| tperl
use Text::Unidecode;
while (<>) {
print unidecode($_);
}'
CCCCcccGGGGggggEIIIIOOOO)
Where are you seeing those characters and how do you know they are not
already in unicode? I.e. That I'm seeing characters "CcGgEIO" but with
accents -- indicates they area already in Unicode.
What are you wanting to do.. just convert them to the ASCII characters
with the accent marks stripped off?
> but I'd
> like to do more with Unicode in the future, without going down any dead-ends as far as
> being able to run under cygwin is concerned.
>
> 2. I see some talk of Internationalization in Chapter 2 of "Setting up Cygwin", but
> cannot see anything relating to perl modules, and I don't see any easy way to search many
> months of the mailing list for a keyword... is there any information I should know about?
>
>
> Thanks,
>
> Mark Aitchison
>
> --
> Problem reports: https://cygwin.com/problems.html
> FAQ: https://cygwin.com/faq/
> Documentation: https://cygwin.com/docs.html
> Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
>
>
More information about the Cygwin
mailing list