unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: guile-user@gnu.org
Subject: Re: Running script from directory with UTF-8 characters
Date: Wed, 23 Dec 2015 22:53:14 +0100	[thread overview]
Message-ID: <874mf8hlx1.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 83poxxnenn.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

> From: Marko Rauhamaa <marko@pacujo.net>
>
>> Why don't you tell me already what emacs does?
>
> I did, you elided that.  It represents text as superset of UTF-8, and
> uses high codepoints above the Unicode space for raw bytes.

Incorrect.  It uses overlong encodings of 0x00-0x7f for raw bytes in the
0x80-0xff range (0x00-0x7f are always represented as themselves).  Those
are not allowed in properly encoded UTF-8 and take only two bytes (byte
patterns 0xc0 0x80–0xbf and 0xc1 0x80–0xbf), so random byte patterns get
inflated by somewhat less than 50% on average (every pattern allowed in
properly encoded UTF-8 is left unchanged, of course).

That's more economical than Python's method which uses the encodings of
surrogate words not allowed in properly encoded UTF-8, taking 3 bytes
rather than the 2 Emacs makes do with.  Using high codepoints above the
Unicode space would even take 4 bytes.

-- 
David Kastrup




  parent reply	other threads:[~2015-12-23 21:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 21:09 Running script from directory with UTF-8 characters Vicente Vera
2015-12-21 23:19 ` Marko Rauhamaa
2015-12-22  0:34   ` Chris Vine
2015-12-22  1:14     ` Marko Rauhamaa
2015-12-22 14:21       ` Chris Vine
2015-12-22 15:55         ` Marko Rauhamaa
2015-12-22 20:12           ` Chris Vine
2015-12-22 20:36             ` Marko Rauhamaa
2015-12-22 20:59               ` Eli Zaretskii
2015-12-22 21:39                 ` Marko Rauhamaa
2015-12-23 18:28                   ` Eli Zaretskii
2015-12-23 19:18                     ` Marko Rauhamaa
2015-12-23 19:33                       ` Eli Zaretskii
2015-12-23 21:15                         ` Marko Rauhamaa
2015-12-23 21:53                         ` David Kastrup [this message]
2015-12-23 22:20                           ` Marko Rauhamaa
2015-12-23 22:25                             ` David Kastrup
2015-12-24 16:13                   ` Barry Schwartz
2015-12-22 14:32   ` Vicente Vera
2015-12-22 15:56     ` Marko Rauhamaa
2015-12-26  1:57       ` Vicente Vera

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/guile/

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

  git send-email \
    --in-reply-to=874mf8hlx1.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=guile-user@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.
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).