Subject: 25.0.50; Files with special chars in the name cannot be written on MS Windows
From: Michael Albinus <[email-masked]>
To: [email-masked]
Date: Mon, 29 Dec 2014 16:56:48 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

The following problem I have observed when running tramp-tests.el on MS
Windows. It isn't a Tramp problem, 'tho.

Files with special characters in their file name cannont be written
locally. The following test is derived from tramp-test30-special-characters.
Note, that this testcase runs w/o problems under GNU/Linux.

--8<---------------cut here---------------start------------->8---
(dolist
    (file
     '(" foo\tbar baz\t"
       "$foo$bar$$baz$"
       "-foo-bar-baz-"
       "%foo%bar%baz%"
       "&foo&bar&baz&"
       "?foo?bar?baz?"
       "*foo*bar*baz*"
       "'foo\"bar'baz\""
       "#foo~bar#baz~"
       "!foo|bar!baz|"
       ":foo;bar:baz;"
       "<foo>bar<baz>"
       "(foo)bar(baz)"
       "[foo]bar[baz]"
       "{foo}bar{baz}"))
  (condition-case err
      (write-region file nil (expand-file-name file temporary-file-directory))
    (error (message "%s" (error-message-string err)))))

=>

Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/ foo	bar baz
Wrote c:/Users/Michael/AppData/Local/Temp/$foo$bar$$baz$
Wrote c:/Users/Michael/AppData/Local/Temp/-foo-bar-baz-
Wrote c:/Users/Michael/AppData/Local/Temp/%foo%bar%baz%
Wrote c:/Users/Michael/AppData/Local/Temp/&foo&bar&baz&
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/?foo?bar?baz?
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/*foo*bar*baz*
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/'foo"bar'baz"
Wrote c:/Users/Michael/AppData/Local/Temp/#foo~bar#baz~
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/!foo|bar!baz|
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/:foo;bar:baz;
Opening output file: invalid argument, c:/Users/Michael/AppData/Local/Temp/<foo>bar<baz>
Wrote c:/Users/Michael/AppData/Local/Temp/(foo)bar(baz)
Wrote c:/Users/Michael/AppData/Local/Temp/[foo]bar[baz]
Wrote c:/Users/Michael/AppData/Local/Temp/{foo}bar{baz}
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.