Subject: 25.3; Encoding of load-file-name wrong when path to working dir does not contain accented letter
From: Márton Marczell <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Fri, 9 Mar 2018 12:22:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

My Windows username is Márton.
In one of the files loaded by my .emacs (neotree.el), I added this line:
   (print load-file-name)

1. I start Emacs from the command line with no arguments.
2. I view the *Messages* buffer.

If the directory from which I launched Emacs has an accent in its path,
e.g. "D:\á\", this is printed:
"c:/Users/Márton/AppData/Roaming/.emacs.d/elpa/neotree-0.5.2/neotree.el"
But if it doesn't, e.g. "D:\a\", this is printed:
"c:/Users/MÃ¡rton/AppData/Roaming/.emacs.d/elpa/neotree-0.5.2/neotree.el"

(This prevents the neotree package from loading images in the latter case.)
Please see also bug#25038, which seems related.

In GNU Emacs 25.3.1 (x86_64-w64-mingw32)
 of 2017-09-26 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 10.0.16299
Configured using:
 'configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3' PKG_CONFIG_PATH=/mingw64/lib/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: HUN
  locale-coding-system: cp1250

Major mode: Messages

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

"TATTARAA TATTARAA TATTARAA"

"c:/Users/Márton/AppData/Roaming/.emacs.d/elpa/neotree-0.5.2/neotree.el"

"c:/Users/Márton/AppData/Roaming/.emacs.d/elpa/neotree-0.5.2/"

Loading c:/Users/Márton/AppData/Roaming/.emacs.d/custom.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message idna rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils vc-git
diff-mode easy-mmode cursor-sensor js2-mode etags xref project js
sgml-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs imenu dired neotree derived finder-inf package
epg-config sql view thingatpt edmacro kmacro python tramp-sh tramp
tramp-compat auth-source cl-seq eieio eieio-core cl-macs gnus-util
mm-util help-fns mail-prsvr password-cache tramp-loaddefs trampver
ucs-normalize shell pcomplete format-spec advice json map seq byte-opt
gv bytecomp byte-compile cl-extra help-mode easymenu cconv comint ring
cl-loaddefs pcase cl-lib ansi-color time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 16 370288 19749)
 (symbols 56 34419 0)
 (miscs 48 60 234)
 (strings 32 62682 11501)
 (string-bytes 1 1969857)
 (vectors 16 54523)
 (vector-slots 8 895948 6275)
 (floats 8 467 185)
 (intervals 56 909 73)
 (buffers 976 20))