Latin Chars and link() problem
Latin Chars and link() problem
am 30.09.2007 23:46:31 von fzarabozo
Hello All,
I'm having a hard time using the function link() to link files to folders =
with latin characters. I don't know how many of you will read the following =
lines correctly (being able to see the latin character) but in case you not=
e =
something weird, the latin character is the equivalent to "ó" in HTM=
L =
(accented 'o'):
link('./compilaci=F3n/file.txt', './compilaci=F3n 2/file.txt') or die $!;
Both folders exist. If i change the accented 'o' to a regular 'o' in both =
folders, i get no errors, but using the accented 'o', i get the following =
error:
Invalid argument at test.pl line 1
I'm automating some tasks over very large amounts of files and i cannot jus=
t =
change the folder names. Also, some files can contain latin characters too. =
The operating system in the server is Windows 2003 Server in Spanish and, a=
s =
long as i can recall, this is the very first time i see this kind of error =
with perl, which is really strange since this is not the first time i work =
with files and i have more than 5 years writting scripts to manage files an=
d =
folders.
Does anyone know how to solve this issue? If so, any help will be highly =
appreciated.
Thank you very much in advance for your time and advice.
Best regards,
Paco Zarabozo
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Latin Chars and link() problem
am 01.10.2007 18:27:01 von fzarabozo
This is a multi-part message in MIME format.
--===============0186937997==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000A_01C8041D.FC580A10"
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C8041D.FC580A10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello Miguel Angelo,
I'm using version 5.8.8 build 817.
Thanks,
Paco
----- Original Message -----=20
From: Miguel Angelo=20
To: Paco Zarabozo A.=20
Sent: Monday, October 01, 2007 10:22 AM
Subject: Re: Latin Chars and link() problem
Hi Paco,
What is the perl version that you are using ?
Miguel
2007/9/30, Paco Zarabozo A. :
> Hello All,
>
> I'm having a hard time using the function link() to link files to =
folders
> with latin characters. I don't know how many of you will read the =
following
> lines correctly (being able to see the latin character) but in case =
you note
> something weird, the latin character is the equivalent to "=F3" in =
HTML
> (accented 'o'):
>
> link('./compilaci=F3n/file.txt', './compilaci=F3n 2/file.txt') or =
die $!;
>
> Both folders exist. If i change the accented 'o' to a regular 'o' in =
both
> folders, i get no errors, but using the accented 'o', i get the =
following
> error:
>
> Invalid argument at test.pl line 1
>
> I'm automating some tasks over very large amounts of files and i =
cannot just
> change the folder names. Also, some files can contain latin =
characters too.
> The operating system in the server is Windows 2003 Server in Spanish =
and, as
> long as i can recall, this is the very first time i see this kind of =
error
> with perl, which is really strange since this is not the first time =
i work
> with files and i have more than 5 years writting scripts to manage =
files and
> folders.
>
> Does anyone know how to solve this issue? If so, any help will be =
highly
> appreciated.
>
> Thank you very much in advance for your time and advice.
>
>
> Best regards,
>
> Paco Zarabozo
>
>
>
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
--=20
Miguel Angelo - Migas
http://migas-sbackup.sourceforge.net/
Google Talk: migas.miguel@gmail.com
------=_NextPart_000_000A_01C8041D.FC580A10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
Hello Miguel Angelo,
I'm using version 5.8.8 build =
817.
Thanks,
Paco
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
href=3D"mailto:migas.miguel@gmail.com">Miguel=20
Angelo
To:
title=3Dfzarabozo@hotmail.com=20
href=3D"mailto:fzarabozo@hotmail.com">Paco Zarabozo A.
Sent: Monday, October 01, 2007 =
10:22=20
AM
Subject: Re: Latin Chars and =
link()=20
problem
Hi Paco,
What is the perl version that =
you are=20
using ?
Miguel
2007/9/30, Paco Zarabozo A. =
<
=
href=3D"mailto:fzarabozo@hotmail.com">fzarabozo@hotmail.com>:
&=
gt;=20
Hello All,
>
> I'm having a hard time using the function =
link() to=20
link files to folders
> with latin characters. I don't know how =
many of=20
you will read the following
> lines correctly (being able to see =
the=20
latin character) but in case you note
> something weird, the =
latin=20
character is the equivalent to "=F3" in HTML
> (accented=20
'o'):
>
> link('./compilaci=F3n/file.txt', =
'./compilaci=F3n=20
2/file.txt') or die $!;
>
> Both folders exist. If i =
change the=20
accented 'o' to a regular 'o' in both
> folders, i get no =
errors, but=20
using the accented 'o', i get the following
> =
error:
>
>=20
Invalid argument at test.pl line 1
>
> I'm automating some =
tasks=20
over very large amounts of files and i cannot just
> change the =
folder=20
names. Also, some files can contain latin characters too.
> The=20
operating system in the server is Windows 2003 Server in Spanish and,=20
as
> long as i can recall, this is the very first time i see =
this kind=20
of error
> with perl, which is really strange since this is not =
the=20
first time i work
> with files and i have more than 5 years =
writting=20
scripts to manage files and
> folders.
>
> Does =
anyone know=20
how to solve this issue? If so, any help will be highly
>=20
appreciated.
>
> Thank you very much in advance for your =
time and=20
advice.
>
>
> Best regards,
>
> Paco=20
Zarabozo
>
>
>
>
>=20
_______________________________________________
> ActivePerl =
mailing=20
list
>
=
href=3D"mailto:ActivePerl@listserv.ActiveState.com">ActivePe rl@listserv.A=
ctiveState.com
>=20
To unsubscribe:
=
href=3D"http://listserv.ActiveState.com/mailman/mysubs">http ://listserv.A=
ctiveState.com/mailman/mysubs
>
--=20
Miguel Angelo - Migas
=
href=3D"http://migas-sbackup.sourceforge.net/">http://migas- sbackup.sourc=
eforge.net/
Google=20
Talk:
href=3D"mailto:migas.miguel@gmail.com">migas.miguel@gmail.co m
OCKQUOTE>
------=_NextPart_000_000A_01C8041D.FC580A10--
--===============0186937997==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0186937997==--
Re: Latin Chars and link() problem
am 01.10.2007 19:48:47 von fzarabozo
Hello Miguel Angelo,
The link() function is compatible with windows. It actually links a file, =
meaning that modifying one of them, both are modified like one single file. =
It works perfectly except for this thing with latin chararcters.
I've been researching on the issue and it seems that since perl 5.8.1 perl =
uses unicode and several things are affected by that.
I found a workarround to this problem. Adding the following line at the =
beggining of the script solves the issue:
######################
use encoding 'latin3';
######################
However, i've read that you can skip the need of putting that line in all o=
f =
your scripts if you set correctly Perl's locals. Unfortunately, i'm still =
not sure of how to do that or where to do it.
Guys, if some of you know how to set locals in Perl installation, i'll =
really appreciate some guidelines to do it myself.
Thanks in advance,
Paco Zarabozo
----- Original Message ----- =
From: Miguel Angelo
To: Paco Zarabozo A.
Sent: Monday, October 01, 2007 11:46 AM
Subject: Re: Latin Chars and link() problem
Hi Paco,
I was finding your unlink thing strange since it has always work for
me since perl 5.6.1 and Windows NT4...
But then i notice you where refering to the link function... i wonder
if THAT function is compatible with windows ! i have yet to find
something to say yes or no to that compatibility question !
But what exactly are you trying to do ? rename a file ?
Migas
2007/10/1, Paco Zarabozo A. :
>
>
> Hello Miguel Angelo,
>
> I'm using version 5.8.8 build 817.
>
> Thanks,
>
> Paco
>
>
>
> ----- Original Message -----
> From: Miguel Angelo
> To: Paco Zarabozo A.
> Sent: Monday, October 01, 2007 10:22 AM
> Subject: Re: Latin Chars and link() problem
>
> Hi Paco,
>
> What is the perl version that you are using ?
>
> Miguel
>
>
>
>
> 2007/9/30, Paco Zarabozo A. :
> > Hello All,
> >
> > I'm having a hard time using the function link() to link files to =
> > folders
> > with latin characters. I don't know how many of you will read the
> following
> > lines correctly (being able to see the latin character) but in case you
> note
> > something weird, the latin character is the equivalent to "=F3" in HTML
> > (accented 'o'):
> >
> > link('./compilaci=F3n/file.txt', './compilaci=F3n 2/file.txt') or die $=
!;
> >
> > Both folders exist. If i change the accented 'o' to a regular 'o' in =
> > both
> > folders, i get no errors, but using the accented 'o', i get the =
> > following
> > error:
> >
> > Invalid argument at test.pl line 1
> >
> > I'm automating some tasks over very large amounts of files and i cannot
> just
> > change the folder names. Also, some files can contain latin characters
> too.
> > The operating system in the server is Windows 2003 Server in Spanish =
> > and,
> as
> > long as i can recall, this is the very first time i see this kind of =
> > error
> > with perl, which is really strange since this is not the first time i =
> > work
> > with files and i have more than 5 years writting scripts to manage files
> and
> > folders.
> >
> > Does anyone know how to solve this issue? If so, any help will be highly
> > appreciated.
> >
> > Thank you very much in advance for your time and advice.
> >
> >
> > Best regards,
> >
> > Paco Zarabozo
> >
> >
> >
> >
> > _______________________________________________
> > ActivePerl mailing list
> > ActivePerl@listserv.ActiveState.com
> > To unsubscribe:
> http://listserv.ActiveState.com/mailman/mysubs
> >
>
>
> --
> Miguel Angelo - Migas
> http://migas-sbackup.sourceforge.net/
> Google Talk: migas.miguel@gmail.com
>
-- =
Miguel Angelo - Migas
http://migas-sbackup.sourceforge.net/
Google Talk: migas.miguel@gmail.com =
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Latin Chars and link() problem
am 01.10.2007 19:51:50 von fzarabozo
Hello Paul,
Thank you for your answer. I tried your suggestion and i got a lot of extra =
warnings. However, it helped me by pointing me in a better direction on how =
to research for the solution. I've found that the following line instead of =
the one you suggested solves the issue:
##################
use encoding 'latin3';
##################
However, it seems like there's a better way to solve it by modifying Perl's =
locals, which i still don't know how or where to do. I'm on that now but, i=
f =
you know something about it, please let me know. :-)
Thanks again.
Best regards,
Paco Zarabozo
----- Original Message ----- =
From: Paul Gowers
To: Paco Zarabozo A.
Sent: Monday, October 01, 2007 2:37 AM
Subject: Re: Latin Chars and link() problem
Hi Paco
Not sure if this will work, but try adding
use utf8;
at the top of your script (after #!/usr/bin/perl line).
Cheers
Paul
On 30 Sep 2007, at 22:46, Paco Zarabozo A. wrote:
> Hello All,
>
> I'm having a hard time using the function link() to link files to
> folders
> with latin characters. I don't know how many of you will read the
> following
> lines correctly (being able to see the latin character) but in case
> you note
> something weird, the latin character is the equivalent to
> "ó" in HTML
> (accented 'o'):
>
> link('./compilaci=F3n/file.txt', './compilaci=F3n 2/file.txt') or die $!;
>
> Both folders exist. If i change the accented 'o' to a regular 'o'
> in both
> folders, i get no errors, but using the accented 'o', i get the
> following
> error:
>
> Invalid argument at test.pl line 1
>
> I'm automating some tasks over very large amounts of files and i
> cannot just
> change the folder names. Also, some files can contain latin
> characters too.
> The operating system in the server is Windows 2003 Server in
> Spanish and, as
> long as i can recall, this is the very first time i see this kind
> of error
> with perl, which is really strange since this is not the first time
> i work
> with files and i have more than 5 years writting scripts to manage
> files and
> folders.
>
> Does anyone know how to solve this issue? If so, any help will be
> highly
> appreciated.
>
> Thank you very much in advance for your time and advice.
>
>
> Best regards,
>
> Paco Zarabozo
>
>
>
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs =
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs