Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.quux.org!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: alexandru.dadalau@meshparts.de (alexandru) Newsgroups: comp.lang.tcl Subject: Re: Remove new line char Date: Thu, 20 Mar 2025 11:56:50 +0000 Organization: novaBBS Message-ID: <539c6aa13dd5c919255a5500bc239cdc@www.novabbs.com> References: <99c3a67de883d847a088f8158aea9998@www.novabbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="986514"; mail-complaints-to="usenet@i2pn2.org"; posting-account="l1iAmVox1ke+zLagusfZ24oI+I+AR96kYETQ9qXKFjg"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$AwBU7DzRRMI0AuNTu24H..pxOKXzJNeU8F.rMv9W1thn1aQLYLqvi X-Rslight-Posting-User: 3217083f22f6079e036efa4232d5f9f8b9be6b49 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. --