Nп/п : 33 из 100
 От   : Rolf Ade                            2:5075/128        07 сен 23 00:16:03
 К    : Michael Soyka                                         07 сен 23 01:18:01
 Тема : Re: Problem with filenames that include emoji characters
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <87jzt3c5i4.fsf@pointsman.de> 4dc5e5f2
@REPLY:
<53eaef44-31be-4cd5-98a4-b535c4b1b1f6n@googlegroups.com> 8b9028be
@REPLYADDR Rolf Ade <rolf@pointsman.de>
@REPLYTO 2:5075/128 Rolf Ade
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: <87jzt3c5i4.fsf@pointsman.de>
@RFC-References:
<53eaef44-31be-4cd5-98a4-b535c4b1b1f6n@googlegroups.com>
@TZUTC: 0200
@PID: Gnus/5.13 (Gnus v5.13) Emacs/28.2
(gnu/linux)
@TID: FIDOGATE-5.12-ge4e8b94
Michael Soyka <mssr953@gmail.com> writes:
> I`m using the Magicsplat distribution of tcl 8.6.12 on a Windows 10
> [...]
> filenames came to include emoji characters.
>
> Now to the problem. When I try to access these files using Tcl, I get
> what I consider to be nonsensical errors. For example, the "open"
> command fails with the message "filename is invalid on this platform",
> even though the file does exist. On the other hand, various "file"
> commands that also take a filename argument, such as "exists" and
> "size", return "no such file or directory". Again, the file certainly
> does exist.

You haven`t shown us how you call that commands in Tcl, with the emoji
literal in the source code or escaped as \\Uxxxxx, for example and what
encoding your source file has.

Since Tcl 8.6.10 I think and for sure with the upcomming Tcl 9 there is
no problem in handling such filenames (with unicode code points in
proper utf.8 in it as emojis).

See for example:

# The following is: a\\U1f972
set fd [open a? w+]
# \\U1f926
puts $fd ?
close $fd

set fd [open a?]
puts [read $fd]
close $fd

This script works for me on linux with 8.6.10, 8.6.13 and 9. Though this
is on linux.

> I haven`t been able to construct such a filename using Tcl commands.
> Instead, I`ve used "glob" to get the filename from the filesystem
> (NTFS) and used the result as the argument for "open" and "file".

So you can construct the filenames with results of Tcl commands and
successfully open the files?

rolf
--- Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
 * Origin: Me (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    
                                                                                
В этой области больше нет сообщений.

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