ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Max Chernoff via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@freedom.nl>
Subject: Re: new hash for buffer (as file)
Date: Mon, 26 Sep 2022 10:47:58 +0200	[thread overview]
Message-ID: <d045f43f-98ea-9ebe-e415-5c39aff0308d@freedom.nl> (raw)
In-Reply-To: <94fa5bd81dd51e448b7c1262e310e9a4a26f6abe.camel@telus.net>

On 9/26/2022 2:05 AM, Max Chernoff via ntg-context wrote:
> 
> Hi Pablo,
> 
>> But now I don’t understand is the following issue: if the saved file
>> contains "\r\n", why does basic Notepad the new lines?
>>
>> "\r\n" are the chars to get new lines in Windows. Or what am I missing here?
> 
> I'm not too sure what you're asking here, but Notepad was somewhat-
> recently updated to handle both CRLF and LF line endings:
> 
>     https://devblogs.microsoft.com/commandline/extended-eol-in-notepad/
>     
> But I do agree that the line ending handling seems a little odd. I find it
> surprising that the buffers internally use CR line endings since no systems
> in the past 20 years use that.

how about tex ...

\number\endlinechar
\number\numexpr`M-`A+1\relax % plain sets up `^^M

... you don't want to know how much hassle dealing with line endings in 
tex is

> Also, you should probably check to make sure that the results of the
> file don't depend on the current code page on Windows. Try writing out a
> buffer from ConTeXt with the following contents:
> 
>     АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя
>     
> First, run "chcp 65001" before running "context" and record the size of the
> file written. Then, run "chcp 1251" and run "context" again. Hopefully the
> file size doesn't change; but if it does, then that means that the binary
> content of any file written will depend on the system's default code page,
> which would complicate making reproducible hashes.
if that were the case nothing would work .. so it's bytes in - bytes out

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-09-26  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 17:25 Pablo Rodriguez via ntg-context
2022-09-23  4:01 ` Max Chernoff via ntg-context
2022-09-23 15:06   ` Pablo Rodriguez via ntg-context
2022-09-25 17:59     ` Pablo Rodriguez via ntg-context
2022-09-26  0:05       ` Max Chernoff via ntg-context
2022-09-26  8:47         ` Hans Hagen via ntg-context [this message]
2022-09-26 23:01           ` Max Chernoff via ntg-context
2022-09-26 17:24         ` Pablo Rodriguez via ntg-context
2022-09-26 18:07           ` Hans Hagen via ntg-context

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

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

  git send-email \
    --in-reply-to=d045f43f-98ea-9ebe-e415-5c39aff0308d@freedom.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@freedom.nl \
    /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 NNTP newsgroup(s).