On Dec 27, 2007 11:46 AM, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
> I am thinking to do something like:
> ...because it requires less code.
>
More legible code is usually far more valuable than shorter code.
From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>
This is the approach I had in mind:
$ cat test.pl
#!/usr/bin/perl
use Encode;
$octets = ;
$chars = decode 'utf8', $octets;
%special = ( "\xc3\x96" => 'O', "\xc3\xa5" => 'a' );
($translated = $octets) =~ s/(\xc3\x96|\xc3\xa5)/$special{$1}/g;
prin
From: "rahed" <[EMAIL PROTECTED]>
[EMAIL PROTECTED] ("Octavian Rasnita") writes:
I want to replace some special characters with their corresponding
Western European chars, for example a with a, â with a, s with s, t
with t, î with i and so on.
The module Text::Unidecode does exactly what you
[EMAIL PROTECTED] ("Octavian Rasnita") writes:
> I want to replace some special characters with their corresponding
> Western European chars, for example a with a, â with a, s with s, t
> with t, î with i and so on.
The module Text::Unidecode does exactly what you look for. The
conversion is not
From: "Dr.Ruud" <[EMAIL PROTECTED]>
"Octavian Rasnita" schreef:
I have also seen that length($string) returns the number of bytes of
$string, and not the number of chars (if the string contains UTF-8
chars).
This tells me that you are taking input from an octet buffer that comes
from outside.
Chas. Owens wrote:
On Dec 26, 2007 2:59 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
Well, then you'll probably need to identify the utf8 octet sequences
that correspond to the special characters you want to see transformed.
snip
Perl strings are in UTF-8*, but if you want to specify a ch
"Octavian Rasnita" schreef:
> I have also seen that length($string) returns the number of bytes of
> $string, and not the number of chars (if the string contains UTF-8
> chars).
This tells me that you are taking input from an octet buffer that comes
from outside.
my $octets = <>;
my $str
From: "Chas. Owens" <[EMAIL PROTECTED]>
>> I believe the OP will need to identify all the characters he would
>> like
>> to see converted, and code the conversion rules himself using the
>> tr///
>> or s/// operator.
>
> Yes I think that it might not be any standard transforming algorithm
> f
On Dec 26, 2007 2:59 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> [ Please only quote what's necessary to give context. ]
> [ Please don't top-post. ]
>
> Octavian Rasnita wrote:
> > Gunnar Hjalmarsson wrote:
> >> I believe the OP will need to identify all the characters he would like
> >> t
[ Please only quote what's necessary to give context. ]
[ Please don't top-post. ]
Octavian Rasnita wrote:
Gunnar Hjalmarsson wrote:
I believe the OP will need to identify all the characters he would like
to see converted, and code the conversion rules himself using the tr///
or s/// operator.
On Dec 26, 2007 9:33 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Tom Phoenix wrote:
> > You might be able to do what you want with Encode.
> >
> > http://perldoc.perl.org/Encode.html
>
> Might he? How?
If what he wants is within the abilities of that module, of course. It
may be that
won't have any issues, because the chars are UTF-8.
Thanks.
Octavian
- Original Message -
From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, December 26, 2007 7:33 PM
Subject: Re: replace chars
Tom Phoenix wrote:
On Dec 26, 2007 3:05 AM, Octavian
Tom Phoenix wrote:
On Dec 26, 2007 3:05 AM, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
I want to replace some special characters with their corresponding Western
European chars, for example a with a, â with a, s with s, t with t, î with i
and so on.
I thought that all those characters were in
On Dec 26, 2007 3:05 AM, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
> I want to replace some special characters with their corresponding Western
> European chars, for example a with a, â with a, s with s, t with t, î with i
> and so on.
>
> Could you please recommend a module that can do this?
Y
Hi,
I want to replace some special characters with their corresponding Western
European chars, for example a with a, â with a, s with s, t with t, î with i
and so on.
Could you please recommend a module that can do this?
I don't know what I need to search on CPAN for and I don't want to do th
15 matches
Mail list logo