unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: adding a new encoding
Date: Tue, 22 Jun 2004 08:44:41 +0900 (JST)	[thread overview]
Message-ID: <200406212344.IAA11732@etlken.m17n.org> (raw)
In-Reply-To: <20040621200633.GF1361@ata.cs.hun.edu.tr> (message from Baurjan Ismagulov on Mon, 21 Jun 2004 22:06:33 +0200)

In article <20040621200633.GF1361@ata.cs.hun.edu.tr>, Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> writes:
> > > * Emacs uses ISO 2022 internally.
> > Not correct.  Emacs uses character codes of each ISO-2022
> > conforming charsets.

> And each character is prepended with a charset code?

Yes, prepended with a charset code of range 0x80..0x9D plus
optional extented charset code of range 0xA0..0xFF, and code
points (0x20..0x7F) are `logior'ed with 0x80.  So a
multibyte representation of character is classified into
these:
	0x00..0x7F
	0x80..0x9D 0xA0..0xFF
	0x80..0x9D 0xA0..0xFF 0xA0..0xFF
	0x80..0x9D 0xA0..0xFF 0xA0..0xFF 0xA0..0xFF

> How do raw bytes
> look like in Emacs memory for, say, \U+0410\U+00DF\U+0534? Is there an
> easy way to see that (princ somewhere in
> lisp/international/mule-cmds.el)?

Try this:

(string-as-unibyte (string (decode-char 'ucs #x0410)
			   (decode-char 'ucs #x00DF)
			   (decode-char 'ucs #x0534)))

M-x list-character-sets also give some information.

But, you'ld better not write a code depending on it.
Unicode-based Emacs (that will come after the release of
current CVS HEAD) uses UTF-8 as a multibyte representation.

---
Ken'ichi HANDA
handa@m17n.org

      reply	other threads:[~2004-06-21 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-19 15:03 adding a new encoding Baurjan Ismagulov
2004-06-20 16:35 ` Baurjan Ismagulov
2004-06-20 23:18   ` Kenichi Handa
2004-06-21 20:06     ` Baurjan Ismagulov
2004-06-21 23:44       ` Kenichi Handa [this message]

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=200406212344.IAA11732@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@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 public inbox

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

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).