unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Subject: Re: Turning HTML character references into something readable?
Date: 27 Apr 2003 17:54:34 +0200	[thread overview]
Message-ID: <m365p0ylz9.fsf@cicero.benny.turtle-trading.net> (raw)
In-Reply-To: shr87oa53h.fsf@tux.gnu.franken.de

Hi Karl,


Karl Eichwalder <keichwa@gmx.net> writes:
> Is there already a fuction to turn these HTML character references
> into proper characters?  "&#1071;" must come out as the cyrillic
> "??" etc.

Actually that literal seems to be in some JIS encoding on my side,
while &#1071; indicates Unicode.

If you want an ELisp function, M-x apropos RET char RET turns up
functions that can be used to convert a Unicode codepoint to a string
that Emacs shows fine here as cyrillic, e.g.:

  (char-to-string (decode-char 'ucs 1071))

If you want to get this into an interactive command, you'd need some
more coding.  Or maybe PSGML or some other SGML/HTML/XML mode may have
that functionality already.

> On the command line recode can do the trick:
> 
>    echo "&#1071;" | recode html..utf-8

You can use shell-command-on-region (M-|) to use "recode html..utf-8"
directly.  Note that M-| is not recognized by some german keyboard
drivers.  But than for everyday use you may want to encapsulate that
into your own command where the "recode" command is hardcoded anyway.


so long, benny

  reply	other threads:[~2003-04-27 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-27  5:20 Turning HTML character references into something readable? Karl Eichwalder
2003-04-27 15:54 ` Benjamin Riefenstahl [this message]
2003-04-27 19:09   ` Karl Eichwalder
2003-04-28 13:02     ` Reiner Steib
2003-04-28 15:20       ` Kai Großjohann
2003-04-28 18:01         ` Reiner Steib
2003-04-29 13:53           ` Kai Großjohann
2003-04-28 17:12     ` Benjamin Riefenstahl
2003-04-29  3:55       ` Karl Eichwalder
2003-04-28 12:17 ` Colin Marquardt

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m365p0ylz9.fsf@cicero.benny.turtle-trading.net \
    --to=benjamin.riefenstahl@epost.de \
    /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.
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).