Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released

Liste des GroupesRevenir à cl tcl 
Sujet : Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released
De : wortkarg3 (at) *nospam* yahoo.com (Harald Oehlmann)
Groupes : comp.lang.tcl
Date : 05. Dec 2024, 16:16:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <visg4p$1ltsf$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
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

Date Sujet#  Auteur
29 Nov 24 * ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released8Harald Oehlmann
5 Dec 24 `* Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released7TorstenBerg
5 Dec 24  `* Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released6Harald Oehlmann
5 Dec 24   `* Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released5Ralf Fassel
5 Dec 24    `* Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released4Harald Oehlmann
5 Dec 24     `* Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released3TorstenBerg
6 Dec 24      +- Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released1Harald Oehlmann
6 Dec 24      `- Re: ANNOUNCE: Excel file format reader/writer package OOXML 1.9 released1Ralf Fassel

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal