Article View: chile.comp.misc
Article #35595Re: Arreglar acentos en Unix
From: Alvaro Herrera
Date: Tue, 30 Dec 1997 00:00
Date: Tue, 30 Dec 1997 00:00
30 lines
1590 bytes
1590 bytes
On Tue, 30 Dec 1997, Alvaro Herrera wrote:
> En realidad se puede hacer simple o complicado... mira esto:
> #!/usr/bin/perl
Ahora si:
#!/usr/bin/perl
open (DATOS, "-");
open (SALIDA, ">-");
while (<DATOS>) {
s/'a/\xE1/g;
s/'e/\xE9/g;
s/'i/\xED/g;
s/'o/\xF3/g;
s/'u/\xFA/g;
s/n~/\361/g;
print SALIDA $_;}
close DATOS;
close SALIDA;
Ojo, que los acentos son distintos en ASCII que en ANSI (por si lo
quieres usar en Windows).
"El realista sabe lo que quiere; el idealista quiere lo que sabe" (Anonimo)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/CS d- s:- a-- C+(++)$ USL++ P++ L++ E--- W+ N++(+) K- w--- O- M-- V?
PE-(--) Y PGP t--- 5-- X-- R- tv- b++>+++ DI++ D+(++) G e+ h! r% y- o? PS+
------END GEEK CODE BLOCK-----
Alvaro Herrera (alvherre@enlaces.c5.cl)
Technical Details
Message-ID:
<Pine.LNX.3.95.971230125730.6466B-100000@enlaces.c5.cl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34A92CB4.28B2@cec.uchile.cl> <Pine.LNX.3.95.971230120500.5212C-100000@enlaces.c5.cl>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit X-Google-Thread: 1054ea,a89f92c8dff1d87b,start X-Google-Attributes: gid1054ea,public X-Google-Thread: 143321,a89f92c8dff1d87b,start X-Google-Attributes: gid143321,public X-Google-Thread: 107d6b,a89f92c8dff1d87b,start X-Google-Attributes: gid107d6b,public From: Alvaro Herrera <alvherre@enlaces.c5.cl> Subject: Re: Arreglar acentos en Unix Date: 1997/12/30 Message-ID: <Pine.LNX.3.95.971230125730.6466B-100000@enlaces.c5.cl> X-Deja-AN: 311388936 References: <34A92CB4.28B2@cec.uchile.cl> <Pine.LNX.3.95.971230120500.5212C-100000@enlaces.c5.cl> Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: DCC - Universidad de Chile Mime-Version: 1.0 Newsgroups: chile.comp.misc,uch.ing.consultas,chile.comp.unix