Sujet : Re: Remove new line char
De : wortkarg3 (at) *nospam* yahoo.com (Harald Oehlmann)
Groupes : comp.lang.tclDate : 21. Mar 2025, 08:32:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrj4ml$12e07$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
Am 20.03.2025 um 19:03 schrieb Rich:
alexandru <alexandru.dadalau@meshparts.de> wrote:
I tried
>
set text [encoding convertfrom cp1252 $text]
>
but no success.
Are you sure the clipboard is cp1252?
If it is utf-8 then converting as if it is cp1252 will create strange
results.
Dear Rich,
the Windows clipboard is more complicated/sophisticated.
Each entry has a type. This is nowdays mostly CF_UNICODETEXT, which is 16 bit unicode.
A sending application can put an entry into the clipboard in multiple formats and the receiving application can pick one or more.
You see that, if you paste a word snippet into LibreOffice. You have multiple options: paste normal (which is Rich Text Format), paste as text (which is a unicode string).
And types may be image, file, folder,...
https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formatsWe have often "enhanced" this code in TCL to adopt it to modern usage. There should not be any issues with the encoding, expect that the sending application does anything strange.
Take care,
Harald