Latin Chars and link() problem

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
fzarabozo [ So, 30 September 2007 23:46 ] [ ID #1832953 ]

Re: Latin Chars and link() problem

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 -----
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. <fzarabozo [at] hotmail.com>:
> 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 [at] listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


--
Miguel Angelo - Migas
http://migas-sbackup.sourceforge.net/
Google Talk: migas.miguel [at] gmail.com

------=_NextPart_000_000A_01C8041D.FC580A10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello Miguel Angelo,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm using version 5.8.8 build =
817.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Paco</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>
<A title=3Dmigas.miguel [at] gmail.com =
href=3D"mailto:migas.miguel [at] gmail.com">Miguel
Angelo</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dfzarabozo [at] hotmail.com
href=3D"mailto:fzarabozo [at] hotmail.com">Paco Zarabozo A.</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, October 01, 2007 =
10:22
AM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Latin Chars and =
link()
problem</DIV>
<DIV><BR></DIV>Hi Paco,<BR><BR>  What is the perl version that =
you are
using ?<BR><BR>Miguel<BR><BR><BR><BR><BR>2007/9/30, Paco Zarabozo A. =
<<A
=
href=3D"mailto:fzarabozo [at] hotmail.com">fzarabozo [at] hotmail.com</A>>:<BR>&=
gt;
Hello All,<BR>><BR>> I'm having a hard time using the function =
link() to
link files to folders<BR>> with latin characters. I don't know how =
many of
you will read the following<BR>> lines correctly (being able to see =
the
latin character) but in case you note<BR>> something weird, the =
latin
character is the equivalent to "=F3" in HTML<BR>> (accented
'o'):<BR>><BR>> link('./compilaci=F3n/file.txt', =
'./compilaci=F3n
2/file.txt') or die $!;<BR>><BR>> Both folders exist. If i =
change the
accented 'o' to a regular 'o' in both<BR>> folders, i get no =
errors, but
using the accented 'o', i get the following<BR>> =
error:<BR>><BR>>
Invalid argument at test.pl line 1<BR>><BR>> I'm automating some =
tasks
over very large amounts of files and i cannot just<BR>> change the =
folder
names. Also, some files can contain latin characters too.<BR>> The
operating system in the server is Windows 2003 Server in Spanish and,
as<BR>> long as i can recall, this is the very first time i see =
this kind
of error<BR>> with perl, which is really strange since this is not =
the
first time i work<BR>> with files and i have more than 5 years =
writting
scripts to manage files and<BR>> folders.<BR>><BR>> Does =
anyone know
how to solve this issue? If so, any help will be highly<BR>>
appreciated.<BR>><BR>> Thank you very much in advance for your =
time and
advice.<BR>><BR>><BR>> Best regards,<BR>><BR>> Paco
Zarabozo<BR>><BR>><BR>><BR>><BR>>
_______________________________________________<BR>> ActivePerl =
mailing
list<BR>> <A
=
href=3D"mailto:ActivePerl [at] listserv.ActiveState.com">ActivePe rl [at] listserv.A=
ctiveState.com</A><BR>>
To unsubscribe: <A
=
href=3D"http://listserv.ActiveState.com/mailman/mysubs">http ://listserv.A=
ctiveState.com/mailman/mysubs</A><BR>><BR><BR><BR>--
<BR>Miguel Angelo - Migas<BR><A
=
href=3D"http://migas-sbackup.sourceforge.net/">http://migas- sbackup.sourc=
eforge.net/</A><BR>Google
Talk: <A
href=3D"mailto:migas.miguel [at] gmail.com">migas.miguel [at] gmail.co m</A><BR></BL=
OCKQUOTE></BODY></HTML>

------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0186937997==--
fzarabozo [ Mo, 01 Oktober 2007 18:27 ] [ ID #1833726 ]

Re: Latin Chars and link() problem

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. <fzarabozo [at] hotmail.com>:
>
>
> 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. <fzarabozo [at] hotmail.com>:
> > 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 [at] listserv.ActiveState.com
> > To unsubscribe:
> http://listserv.ActiveState.com/mailman/mysubs
> >
>
>
> --
> Miguel Angelo - Migas
> http://migas-sbackup.sourceforge.net/
> Google Talk: migas.miguel [at] gmail.com
>


-- =

Miguel Angelo - Migas
http://migas-sbackup.sourceforge.net/
Google Talk: migas.miguel [at] gmail.com =


_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
fzarabozo [ Mo, 01 Oktober 2007 19:48 ] [ ID #1833727 ]

Re: Latin Chars and link() problem

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 [at] listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs =


_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
fzarabozo [ Mo, 01 Oktober 2007 19:51 ] [ ID #1833728 ]
Perl » gmane.comp.lang.perl.active-perl » Latin Chars and link() problem

Vorheriges Thema: PerlEx on windows server 2003, 64 bit
Nächstes Thema: Problem with installing ActivePerl