unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* utf-8 to standard output?
@ 2011-02-25  8:28 Herbert Schiemann
  2011-02-26 21:47 ` Peter Dyballa
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Schiemann @ 2011-02-25  8:28 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-28 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25  8:28 utf-8 to standard output? Herbert Schiemann
2011-02-26 21:47 ` Peter Dyballa
2011-02-28 10:16   ` Herbert Schiemann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).