;; On systems which have no quoting style, file names
;; with special characters could fail.
(cond
- ((tramp-get-ls-command-with vec "--quoting-style=c"))
+ ((tramp-get-ls-command-with
+ vec "--quoting-style=literal --show-control-chars"))
((tramp-get-ls-command-with vec "-w"))
(t ""))
(tramp-shell-quote-argument localname)))
;; On systems which have no quoting style, file names with special
;; characters could fail.
(cond
- ((tramp-get-ls-command-with vec "--quoting-style=shell"))
+ ((tramp-get-ls-command-with
+ vec "--quoting-style=literal --show-control-chars"))
((tramp-get-ls-command-with vec "-w"))
(t ""))
(tramp-get-remote-stat vec)
filename switches wildcard full-directory-p)
(when (stringp switches)
(setq switches (split-string switches)))
- (when (tramp-get-ls-command-with v "--quoting-style=literal")
- (setq switches (append switches '("--quoting-style=literal"))))
+ (when (tramp-get-ls-command-with
+ v "--quoting-style=literal --show-control-chars")
+ (setq switches
+ (append
+ switches '("--quoting-style=literal" "--show-control-chars"))))
(unless (tramp-get-ls-command-with v "--dired")
(setq switches (delete "--dired" switches)))
(when wildcard
(when (string-match "^d" (nth 8 attr))
(setcar attr t))
;; Convert symlink from `tramp-do-file-attributes-with-stat'.
+ ;; Decode also multibyte string.
(when (consp (car attr))
- (if (and (stringp (caar attr))
- (string-match ".+ -> .\\(.+\\)." (caar attr)))
- (setcar attr (match-string 1 (caar attr)))
- (setcar attr nil)))
+ (setcar attr
+ (and (stringp (caar attr))
+ (string-match ".+ -> .\\(.+\\)." (caar attr))
+ (decode-coding-string (match-string 1 (caar attr)) 'utf-8))))
;; Set file's gid change bit.
(setcar (nthcdr 9 attr)
(if (numberp (nth 3 attr))
(coding-system-change-eol-conversion utf8 'unix)))
(apply
'tramp--test-check-files
- (if (tramp--test-expensive-test)
- (delete-dups
- (mapcar
- ;; Use all available language specific snippets. Filter
- ;; out strings which use unencodable characters. Remove
- ;; slash or newline. Not Tramp's business.
- (lambda (x)
- (setq x (eval (cdr (assoc 'sample-text x))))
- (unless (or (null x)
- (unencodable-char-position
- 0 nil file-name-coding-system nil x)
- (string-match "TaiViet" x))
- ;; ?\n and ?/ shouldn't be part of any file name. ?\t,
- ;; ?. and ?? do not work for "smb" method.
- (replace-regexp-in-string "[\t\n/.?]" "" x)))
- language-info-alist))
-
- (list
- (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
- (unless (tramp--test-hpux-p)
- "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
- "银河系漫游指南系列"
- "Автостопом по гала́ктике")))))
+ (append
+ (list
+ (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
+ (unless (tramp--test-hpux-p)
+ "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
+ "银河系漫游指南系列"
+ "Автостопом по гала́ктике"
+ ;; Use codepoints without a name. See Bug#31272.
+ "\99\9b\9abung")
+
+ (when (tramp--test-expensive-test)
+ (delete-dups
+ (mapcar
+ ;; Use all available language specific snippets. Filter out
+ ;; strings which use unencodable characters.
+ (lambda (x)
+ (and
+ (stringp (setq x (eval (get-language-info (car x) 'sample-text))))
+ (not (unencodable-char-position
+ 0 nil file-name-coding-system nil x))
+ ;; ?\n and ?/ shouldn't be part of any file name. ?\t,
+ ;; ?. and ?? do not work for "smb" method.
+ (replace-regexp-in-string "[\t\n/.?]" "" x)))
+ language-info-alist)))))))
(ert-deftest tramp-test39-utf8 ()
"Check UTF8 encoding in file names and file contents."