Sujet : Re: Remove new line char
De : alexandru.dadalau (at) *nospam* meshparts.de (alexandru)
Groupes : comp.lang.tclDate : 20. Mar 2025, 12:56:50
Autres entêtes
Organisation : novaBBS
Message-ID : <539c6aa13dd5c919255a5500bc239cdc@www.novabbs.com>
References : 1 2 3 4 5 6 7
User-Agent : Rocksolid Light
On Thu, 20 Mar 2025 10:22:54 +0000, Harald Oehlmann wrote:
Hi Alexandru,
please allow me to share this wish 8.6.14 32 bit session:
>
Excel 2013 with a cell with the content "AÄ".
>
AÄ
>
% clipboard get
AÄ
>
% lmap i [split $c ""] {scan $i %c}
65 196 10
% string trimright $c "\x0a"
AÄ
%
>
So, "string trimright \x0a" does the job for me.
>
Take care,
Harald
Harald, I think you indirectly showed me the causing issue: It's:
::twapi::read_clipboard 1
Somehow it does different things than "clipboard get".
In the twapi manual it states:
"The content is an exact copy of the contents of the clipboard in binary
format. Callers will need to use Tcl commands such as binary and
encoding to parse the data."
I tried
set text [encoding convertfrom cp1252 $text]
but no success.
--