Nп/п : 18 из 100
 От   : Peter Dean                          2:5075/128        31 авг 23 15:03:44
 К    : Simon Geard                                           31 авг 23 08:06:02
 Тема : Re: Converting from utf-16le to ascii or utf-8
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> 4461cebe
@REPLY: 1@dont-email.me> 77444b3a
@REPLYADDR Peter Dean <peterd@nospam.net>
@REPLYTO 2:5075/128 Peter Dean
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
@TZUTC: 1000
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 31/8/23 04:37, Simon Geard wrote:
> So I have a data file containing ascii characters which is UTF-16LE 
> encoded (output from Powershell). I`d like to do two things with this 
> file from tcl on both Windows and Linux:

> 1) detect that it is utf-16le
> 2) convert it to ascii (or utf-8)

> Looking at the output from [encoding names] on Linux there is no 
> utf-16le, does it have a different name? It looks to me as if I could 
> just read the file two bytes at a time and drop the second byte but I 
> was hoping I could use fconfigure and encoding.

> Thanks for any ideas.

> Simon

https://wiki.tcl-lang.org/page/Unicode+file+reader

but I just use notepad++ and save as utf-8

Peter
--- Mozilla Thunderbird
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх