all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Herbert Schiemann <h.schiemann@herbaer.de>
To: help-gnu-emacs@gnu.org
Subject: utf-8 to standard output?
Date: Fri, 25 Feb 2011 09:28:45 +0100	[thread overview]
Message-ID: <1298622525.8187.11.camel@lena.herbaer> (raw)

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	other threads:[~2011-02-25  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25  8:28 Herbert Schiemann [this message]
2011-02-26 21:47 ` utf-8 to standard output? Peter Dyballa
2011-02-28 10:16   ` Herbert Schiemann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298622525.8187.11.camel@lena.herbaer \
    --to=h.schiemann@herbaer.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.