🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1015

Re: bash y lineas de texto texto

#1015
From: AnimAlf
Date: Sun, 18 Jun 2006 10:35
49 lines
2525 bytes
--=-GfmKqb2IwQUtPx0qrmzb
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

El dg 18 de 06 del 2006 a les 11:46 +0200, en/na pacolinx va escriure:
> Quiero acceder a un fichero de texto, para coger lineas.
> Las lineas tienen acentos, y me saca caracteres raros.
> Si escribo texto con acento en consola me funcionan.
> Pero al congerlos de un fichero de texto no.
> Algien sabe como solucionarlo?
> Mil gracias.

Debe ser utf8 vs iso8859-1/15

En perl yo utiliz=C3=A9:
Unicode::MapUTF8 qw(from_utf8)

para hacer esta funci=C3=B3n

sub flushChars {
  my ($tmpStr) =3D @_;
  $tmpStr =3D~ s/([\200-\377]+)/from_utf8({ -string =3D> $1, -charset =3D>
'ISO-8859-1'})/eg
    if $modUniCode;
  return $tmpStr;
}

para mostrar en witgeds gtk2 los caracteres que estaban en utf8 ya que
no me los reconoc=C3=ADa.

Si es tu mismo caso te puede servir.

--=-GfmKqb2IwQUtPx0qrmzb
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: =?ISO-8859-1?Q?Aix=F2?= =?ISO-8859-1?Q?_=E9s?= una part
	d'un missatge, signada digitalment

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iQCVAwUARJUshR535IyztBIVAQLgpwP9HeFYwgjr+appDfNhsddb6boGSMp4s5G8
+xq2wCwhOC33TgtE1cLw22TohmPOU4P+YXo5nKiFYcUpwZEMZuWy70ZfgPKvma+E
OJyaPI4oPJM1AJNZsMgBvGNV1/p7CDk+uPby1urT6J1mWmfxXqKgxyNmvDgnU2+Z
ip53wxB4jds=
=HsbF
-----END PGP SIGNATURE-----

--=-GfmKqb2IwQUtPx0qrmzb--
Technical Details
Message-ID: <1150626950.15419.9.camel@general.engendro.sytes.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!telenews.teleline.es!not-for-mail
References: <70kfm3-gvi.ln1@aldarias.dyndns.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,7c4ad76c07fbd5b1
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,UTF8
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!telenews.teleline.es!not-for-mail
X-Trace-PostClient-IP: 80.32.76.249
Newsgroups: es.comp.os.linux.programacion
Subject: Re: bash y lineas de texto texto
From: AnimAlf <AnimAlf@engendro.sytes.net>
In-Reply-To: <70kfm3-gvi.ln1@aldarias.dyndns.org>
References: <70kfm3-gvi.ln1@aldarias.dyndns.org>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GfmKqb2IwQUtPx0qrmzb"
Organization: Is the truth out there?
Message-ID: <1150626950.15419.9.camel@general.engendro.sytes.net>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Lines: 50
Date: Sun, 18 Jun 2006 10:35:50 GMT
NNTP-Posting-Host: 10.20.31.4
X-Complaints-To: usenet@teleline.es
X-Trace: telenews.teleline.es 1150626950 10.20.31.4 (Sun, 18 Jun 2006 12:35:50 MET DST)
NNTP-Posting-Date: Sun, 18 Jun 2006 12:35:50 MET DST