help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

utf-8 to standard output?


From: Herbert Schiemann
Subject: utf-8 to standard output?
Date: Fri, 25 Feb 2011 09:28:45 +0100

I have a problem using princ to write utf-8 - encoded text to standard
output. I tried this script:

#!/usr/bin/emacs --script
;;; umlaut.el --- Kodierung der Ausgabe

;;; Code:

(princ "Ä\n")
(princ (encode-coding-string "Ä\n" 'utf-8))

;; Local Variables:
;; coding:utf-8
;; End:

;;; umlaut.el ends here

and I get

herbaer@lena:~$ ./umlaut.el > umlaut
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs22/site-start.d/35elib-startup.el (source)...
Loading /etc/emacs/site-start.d/50css-mode.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...
Loading /etc/emacs/site-start.d/50gcl.el (source)...
Loading /etc/emacs/site-start.d/50html-helper-mode.el (source)...
Loading /etc/emacs/site-start.d/55mell.el (source)...
Loading /etc/emacs22/site-start.d/60nxml-mode.el (source)...
Loading /usr/share/emacs22/site-lisp/nxml-mode/rng-auto.el (source)...
herbaer@lena:~$ hexdump -C umlaut
00000000  81 c4 0a c3 9e a4 0a                              |.......|
00000007
herbaer@lena:~$ emacs --version
GNU Emacs 22.2.1
Copyright (C) 2008 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
herbaer@lena:~$ 

I want to output the letter "Ä" as 0xc3a4.
What is going wrong?

Thanks, Herbert Schiemann





reply via email to

[Prev in Thread] Current Thread [Next in Thread]