From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: how to calculate the size of string in bytes? Date: Tue, 18 Aug 2015 21:30:49 +0200 Message-ID: <20150818193049.GA24519@tuxteam.de> References: <20150818101352.GA6744@tuxteam.de> <83mvxoll2g.fsf@gnu.org> <20150818144530.GB15783@tuxteam.de> <83k2sslk0d.fsf@gnu.org> <20150818160145.GA18309@tuxteam.de> <83fv3glfm0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed X-Trace: ger.gmane.org 1439926281 13964 80.91.229.3 (18 Aug 2015 19:31:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Aug 2015 19:31:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 18 21:31:20 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZRmbM-0006yY-8K for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Aug 2015 21:31:16 +0200 Original-Received: from localhost ([::1]:59268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRmbL-0007yI-Fi for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Aug 2015 15:31:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRmb5-0007su-VH for help-gnu-emacs@gnu.org; Tue, 18 Aug 2015 15:31:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRmb1-00087L-Sy for help-gnu-emacs@gnu.org; Tue, 18 Aug 2015 15:30:59 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:36092 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRmax-00086F-DG; Tue, 18 Aug 2015 15:30:51 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ZRmav-0006SO-LE; Tue, 18 Aug 2015 21:30:49 +0200 In-Reply-To: <83fv3glfm0.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106683 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Aug 18, 2015 at 07:35:03PM +0300, Eli Zaretskii wrote: > > Date: Tue, 18 Aug 2015 18:01:45 +0200 > > Cc: help-gnu-emacs@gnu.org > > From: > > > > I was thinking of "characters not expressible in UTF-8". Does Emacs have > > those? > > Raw bytes come out as themselves (which might be invalid UTF-8), but > that's not a failure, that's the user's fault, because they had those > bytes in the buffer to begin with. I was having difficulties in understanding you, so I tried it out. Now I understand: Emacs's internal (raw) coding system can represent "characters not expressible in utf-8". The function encode-coding-string passes those bytes silently through, outputting an invalid utf-8 sequence. So I venture the guess that when the Emacs buffer contains something epressible as valid utf-8, 'utf-8 and 'raw are equivalent (what about combining characters?) Thanks for the insights - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlXTh+kACgkQBcgs9XrR2kZH2QCcDjlnu5BP0UxHnBweCdE9revf sYoAn0fwO/WeoGirGfLlqA3lH1Cp9Bco =IAVl -----END PGP SIGNATURE-----