🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #650

Re: ja się zwie metoda konwersująca napis z 8859-2 do utf-8 ?

#650
From: Jakub Kuźma
Date: Sun, 16 Sep 2007 22:56
22 lines
1452 bytes
Dnia Sun, 16 Sep 2007 23:31:23 +0200
Szymon 'tichy' <fooshmoo@glombraz.org> napisał(a):

> Potrzebuję przynajmniej możliwości zapisu czegoś
> co mam jako napis w 8859-x do pliku 'kodowanego' w utf-8.

Konwersję kodowania znaków zapewnia klasa Iconv znajdująca się w
bibliotece standardowej języka:

http://www.ruby-doc.org/stdlib/libdoc/iconv/rdoc/index.html

Przykładowe użycie:
require 'iconv'
...
unicode_string = Iconv.iconv('UTF-8', 'ISO-8859-2', iso_string)

Pozdrawiam.

-- 
Jakub Kuźma
http://jah.pl/
JID oraz e-mail w domenie gmail.com, login - qoobaa
Technical Details
Message-ID: <20070917005659.7f3c15a2@kuba-laptop>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.vectranet.pl!not-for-mail
References: <fck7l7$lq$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.vectranet.pl!not-for-mail
From: Jakub Kuźma <qoobaa@gmail.com>
Newsgroups: pl.comp.lang.ruby
Subject: Re: ja się zwie metoda
 konwersująca napis z 8859-2 do utf-8 ?
Date: Mon, 17 Sep 2007 00:56:59 +0200
Organization: VectraNET - http://www.vectranet.pl
Lines: 23
Message-ID: <20070917005659.7f3c15a2@kuba-laptop>
References: <fck7l7$lq$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: 82.139.21.4
Mime-Version: 1.0
X-Trace: news.vectranet.pl 1189982805 20856 82.139.21.4 (16 Sep 2007 22:46:45 GMT)
X-Complaints-To: usenet@news.vectranet.pl
NNTP-Posting-Date: Sun, 16 Sep 2007 22:46:45 +0000 (UTC)
X-Newsreader: Sylpheed-Claws 2.6.0 (GTK+ 2.10.11; i486-pc-linux-gnu)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit