help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to calculate the size of string in bytes?


From: tomas
Subject: Re: how to calculate the size of string in bytes?
Date: Tue, 18 Aug 2015 22:11:18 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Aug 18, 2015 at 10:49:58PM +0300, Eli Zaretskii wrote:
> > Date: Tue, 18 Aug 2015 21:30:49 +0200
> > Cc: address@hidden
> > From:  <address@hidden>
> > 
> > I was having difficulties in understanding you
> 
> Sorry about that.  It's a complex issue to explain in a few words.

No need to be sorry. The fault's on me -- once I did my homework
things improved :-)

Thanks for your patience: very much appreciated.

> > Now I understand: Emacs's internal (raw) coding system can represent
> > "characters not expressible in utf-8".
> 
> More accurately, it can represent characters outside the Unicode code
> space.
> 
> And please don't call that "raw"; the internal representation of
> characters used by Emacs is known as 'utf-8-emacs'.

Ah, OK. Point taken.

> > The function encode-coding-string passes those bytes silently
> > through, outputting an invalid utf-8 sequence.
> 
> Yes.  Although in interactive functions Emacs will normally complain
> and ask for a better encoding.

Understood

> > So I venture the guess that when the Emacs buffer contains something
> > epressible as valid utf-8, 'utf-8 and 'raw are equivalent
> 
> Yes.
> 
> > (what about combining characters?)
> 
> Emacs doesn't normalize/compose/decompose characters when it encodes
> text (with a notable exception of the utf-8-hfs encoding).
> Applications that want this should do that themselves, e.g. using the
> facilities in ucs-normalize.el.

Thanks: I learned quite a bit now :-)

regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEUEARECAAYFAlXTkWYACgkQBcgs9XrR2kaQbwCggSK12zVBjHiFowFVsddq36SJ
XmAAmON/V8XcGaUfjxW1llhEavSqcp0=
=fYz9
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]