Deutsch   English   Français   Italiano  
<visg4p$1ltsf$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Harald Oehlmann <wortkarg3@yahoo.com>
Newsgroups: comp.lang.tcl
Subject: Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9
 released
Date: Thu, 5 Dec 2024 16:16:41 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <visg4p$1ltsf$1@dont-email.me>
References: <vicj0q$10cg3$2@dont-email.me>
 <23d440f2cbb17d78d4e5446b910ef11d@www.novabbs.com>
 <vis7nh$1idt0$1@dont-email.me> <ygamsha89we.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 05 Dec 2024 16:16:42 +0100 (CET)
Injection-Info: dont-email.me; posting-host="06c3a575ba4389d4db04bb9be5ea5904";
	logging-data="1767311"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+pKvbJZqKj3pzMQl9iUvvg"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zBn0S9KTL9o4W2ZnRfzQMFzMzt8=
Content-Language: en-GB
In-Reply-To: <ygamsha89we.fsf@akutech.de>
Bytes: 2747

Am 05.12.2024 um 15:46 schrieb Ralf Fassel:
> * Harald Oehlmann <wortkarg3@yahoo.com>
> | About the "Umlauts". This should be an internal issue. The outputted
> | data is utf-8 afaik. But this is critical.
> | I have tested Umlauts when reading and that works.
> | I had to add an "encoding convertfrom utf-8 $data" to make it work.
> 
> Wouldn't that not also depend on how exactly the TCL script is sourced?
> I.e. an tcl script containing literal utf-8 data (not the \uxxxx form)
> on Windows with the default system encoding (eg cp1252) would require an
> explicit -encoding utf8 for the 'source' command to read it properly.
> The OP did not specify what OS he was on, and how the tcl script
> containing utf-8 data was sourced...
> 
> R'

Ralf,
my message was mis-leading: I have introduced the converfrom into the 
source code for reading Excel (not writing). Eventually, this is missing 
or there is another error, I don't know.

Looking a bit in the source code:
proc ooxml::Dom2zip {zf node path cd count} {
   upvar $cd mycd
   upvar $count mycount
   append mycd [::ooxml::add_str_to_archive $zf $path [$node asXML 
-indent none -xmlDeclaration 1 -encString "UTF-8"]]
   incr mycount
}

Ok, always UTF-8

Later:
proc ::ooxml::add_str_to_archive {zipchan path data {comment {}}} {
....
set utfdata [encoding convertto utf-8 $data]

So, I see no issue in the code. I have no idea, what happens here.

I would write the relevant data to an utf-8 flat file for debug

set h [open debug.txt w]
fconfigure $h -encoding utf-8
puts $h $data
close $h

Thanks,
Harald