From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "=?utf-8?Q?G=C3=B6ran?= Uddeborg" Newsgroups: gmane.emacs.bugs Subject: No coding system used for environment variables Date: Thu, 21 Feb 2008 22:40:40 +0100 Message-ID: <200802212140.m1LLeebW008878@freddi.uddeborg.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1203649167 11364 80.91.229.12 (22 Feb 2008 02:59:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2008 02:59:27 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 22 03:59:52 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSO8Z-00006u-Op for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Feb 2008 03:59:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSO84-0001QC-L7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Feb 2008 21:59:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSJ9r-0003Jm-43 for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2008 16:40:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSJ9p-0003Iw-S0 for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2008 16:40:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSJ9p-0003Ij-Mi for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2008 16:40:45 -0500 Original-Received: from proxy2.bredband.net ([195.54.101.72]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSJ9o-0005KK-VD for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2008 16:40:45 -0500 Original-Received: from ironport2.bredband.com (195.54.101.122) by proxy2.bredband.net (7.3.127) id 47A0972700700E35 for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2008 22:40:41 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYjALt+vUdT46hkQWdsb2JhbACBWY56AQEBHhmfdQ Original-Received: from ua-83-227-168-100.cust.bredbandsbolaget.se (HELO mimmi.uddeborg.se) ([83.227.168.100]) by ironport2.bredband.com with ESMTP; 21 Feb 2008 22:40:41 +0100 Original-Received: from freddi.uddeborg.se (freddi.uddeborg.se [172.17.0.3]) by mimmi.uddeborg.se (8.14.2/8.14.2) with ESMTP id m1LLeeFZ015623 for ; Thu, 21 Feb 2008 22:40:40 +0100 Original-Received: from freddi.uddeborg.se (localhost.localdomain [127.0.0.1]) by freddi.uddeborg.se (8.14.2/8.14.2) with ESMTP id m1LLeeuZ008881 for ; Thu, 21 Feb 2008 22:40:40 +0100 Original-Received: (from goeran@localhost) by freddi.uddeborg.se (8.14.2/8.14.2/Submit) id m1LLeebW008878; Thu, 21 Feb 2008 22:40:40 +0100 X-URL: http://www.uddeborg.se/g%C3%B6ran/ X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Thu, 21 Feb 2008 21:59:12 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17556 Archived-At: It seems there is no coding system applied to values of environment variables. I'm running a system using UTF-8. My locale is sv_SE.utf8. And emacs uses UTF-8 as default most of the time. When I open a new file for example. I do have issues with strings coming from environment variables though. I first discovered this in the vm mail system, since it misinterpreted the variable MAIL which has the value /var/spool/mail/g=C3=B6ran encoded in UTF-8. (In case your mailer mangle= s it, the last file name component is g ö r a n.) But it also causes problems in various places, for example with functions relating to the home directory. $HOME is /home/g=C3=B6ran (same last component as before). As an example, I start emacs in my home directory, and do a few experiments in the scratch buffer (which has a "u" for coding system in the mode line): default-directory "/home/g=C3=B6ran/" Looks good. I see my ö. (expand-file-name "") "/home/g=C3=B6ran" Ok too. (expand-file-name "~") "/home/g\303\266ran" Here the octal codes for a UTF-8 encoded ö is shown instead of the ö itself. The source of ~ is the environment variable HOME. But if I explicitly ask for that variable: (getenv "HOME") "/home/g=C3=B6ran" Here I see the ö. Let's have a bit more fun. Here I try to expand a FILE with my own name: (expand-file-name "g=C3=B6ran") "/home/g=C3=B6ran/g=C3=B6ran" Looks the way I expected it. Now the same thing, explicitly saying to put it in the home directory: (expand-file-name "~/g=C3=B6ran") "/home/g\xc3\xb6ran/g=C3=B6ran" The ö in the file name is ok. The ö in the directory name is strange again, only this time it is shown in hex rather than octal. I asked about this on gnu.emacs.help first, (http://groups.google.se/group/gnu.emacs.help/browse_thread/thread/80258d= 0a17e37138/75411fce63db9b2c#75411fce63db9b2c) I was unsure if it was a bug or my lack of understanding. But two other posters have suggested I report it as a bug. In GNU Emacs 22.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.12.1) of 2007-11-06 on xenbuilder2.fedora.redhat.com Windowing system distributor `The X.Org Foundation', version 11.0.7010100= 0 configured using `configure '--build=3Dx86_64-redhat-linux-gnu' '--host=3D= x86_64-redhat-linux-gnu' '--target=3Dx86_64-redhat-linux-gnu' '--program-= prefix=3D' '--prefix=3D/usr' '--exec-prefix=3D/usr' '--bindir=3D/usr/bin'= '--sbindir=3D/usr/sbin' '--sysconfdir=3D/etc' '--datadir=3D/usr/share' '= --includedir=3D/usr/include' '--libdir=3D/usr/lib64' '--libexecdir=3D/usr= /libexec' '--localstatedir=3D/var' '--sharedstatedir=3D/usr/com' '--mandi= r=3D/usr/share/man' '--infodir=3D/usr/share/info' '--with-pop' '--with-so= und' '--with-gtk' 'build_alias=3Dx86_64-redhat-linux-gnu' 'host_alias=3Dx= 86_64-redhat-linux-gnu' 'target_alias=3Dx86_64-redhat-linux-gnu' 'CFLAGS=3D= -DMAIL_USE_LOCKF -DSYSTEM_PURESIZE_EXTRA=3D16777216 -O2 -g -pipe -Wall -W= p,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector --param=3Dssp-buff= er-size=3D4 -m64 -mtune=3Dgeneric'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: sv_SE.utf8 locale-coding-system: utf-8 default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: which-function-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t transient-mark-mode: t Recent input: ? M-< C-n C-k C-k =20 C-y =20 p =20 =20 C-j C-x 4 C-f . e m C-s=20 v m - s p o o M-< C-x C-f . v m C-g C-x C-f ~ / . v=20 m C-s C-g C-_ C-s v m - s p o o l - f i l=20 e s C-a ; C-x C-s =20 q C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-c C-g =20 C-x M q q C-x M n n n n n n=20 n M-< C-s S E C C-a SPC =20 C-x C-f ~ / N C-x c C-a C-k r p m g=20 r e p SPC l h a ! =20 =20 =20 =20 d C-u C-u C-u C-x o=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p M->=20 C-x o C-x C-f u p d =20 M-> C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p SPC n n d d d e =20 =20 =20 =20 =3D C-c C-c=20 SPC SPC =20 =20 n s I q d SPC=20 M-x r e p o r Recent messages: End of message 1059 from G=C3=B6ran Uddeborg Loading vm-digest...done Decoding MIME message... done End of message 1 from Gunilla Christensson 1 message saved to buffer INBOX Quitting... Decoding MIME message... done End of message 1060 from G=C3=B6ran Uddeborg Making completion list... Loading emacsbug...done