emacs-devel
[Top][All Lists]
Advanced

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

Re: Characters saved mismatch?


From: Angelo Graziosi
Subject: Re: Characters saved mismatch?
Date: Sun, 7 May 2017 11:15:39 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0



Il 07/05/2017 10:56, Yuri Khan ha scritto:
On Sun, May 7, 2017 at 6:27 AM, Angelo Graziosi
<address@hidden> wrote:

   Wrote ‘c:/msys64/tmp/foo.text’ (8 characters)

but

   ls -l foo.text
   -rw-r--r-- 1 bingo bongo 10  7 mag 01.07 foo.text

10 bytes!

You are comparing a character count against a byte count. Well *of
course* they are going to be different. The assumption “one character
is encoded by one byte” has been false for quite a while now.


Someone should explain the meaning of "Wrote ‘c:/msys64/tmp/foo.text’ (8 characters)".

If it refers to the number of characters, my example contains 6 characters: f-o-o-b-a-r and not 8.

As I wrote, in Windows Emacs uses DOS style, more precisely 'utf-8-dos'. That should mean 1 byte/ch and CR+LF for end line (RET). This mean that

foo RET
bar RET

should contain (3+2) * 2 = 10 bytes as, 'ls' shows..

Then, where does "Wrote ‘c:/msys64/tmp/foo.text’ (8 characters)" came from, on Windows?



reply via email to

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