🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.tcl
Article #443

Re: Problem z zapisem do pliku ze zmienionym kodowaniem.

#443
From: Googie
Date: Sat, 16 Dec 2006 14:46
22 lines
1464 bytes
moozyk wrote:

> Trochę to zagmatwane,

Owszem :)

Od początku - do pobrania strony możesz ustawić tryb binarny ("-binary
true" do "geturl"), żeby Tcl nie próbował interpretować danych strony
wg. swojego kodowania. Wtedy robisz (zakładając że dane masz
w 'data'):

set data [encoding convertfrom "kodowanie użyte na stronie" $data]
set data [encoding convertto "utf-8" $data]

set fp [open plik w]
fconfigure $fp -encoding binary -translation binary
puts $fp $data
close $fp

-- 
Pozdrawiam (Regards)!
Googie
Technical Details
Message-ID: <em0ta3$937$1@atlantis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!news.internetia.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <eluuq7$coc$1@inews.gazeta.pl> <elv304$f4b$1@atlantis.news.tpi.pl> <em0qtn$bur$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!news.internetia.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: Googie <googie@nospam.0rg>
Newsgroups: pl.comp.lang.tcl
Subject: Re: Problem z zapisem do pliku ze zmienionym kodowaniem.
Date: Sat, 16 Dec 2006 14:46:02 +0000
Organization: tp.internet - http://www.tpi.pl/
Lines: 22
Message-ID: <em0ta3$937$1@atlantis.news.tpi.pl>
References: <eluuq7$coc$1@inews.gazeta.pl> <elv304$f4b$1@atlantis.news.tpi.pl> <em0qtn$bur$1@inews.gazeta.pl>
NNTP-Posting-Host: cafemax.eu.org
Mime-Version: 1.0
X-Trace: atlantis.news.tpi.pl 1166276740 9319 85.128.51.194 (16 Dec 2006 13:45:40 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Sat, 16 Dec 2006 13:45:40 +0000 (UTC)
User-Agent: KNode/0.10.4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit