Am 05.12.2024 um 15:46 schrieb Ralf Fassel:
* Harald Oehlmann <[email protected]>
| 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
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)