Manual join function and encoding

4 views
Skip to first unread message

Julius Hamilton

unread,
Oct 4, 2021, 5:10:29 AM10/4/21
to v...@vim.org

Hey,


I’d like to write some scripts which will act like a join function but manually.


If we open some file, let’s say in the computer it’s in some binary code where each character is a string of digits. Then I assume these strings get mapped to characters via the encoding; the most standard is UTF-8. I believe in UTF-8 the end of a line would just be a newline character “\n” rather than there being an end of line character “$” and then a newline character “\n”, is this correct? Does Vim insert the end of line character “$”? I tried to perform a substitution function on the EOL character “$” but I found nothing was substituted. For this reason I am thinking this is not a character in the actual file. Is this true?


Best,

Julius

jr

unread,
Oct 4, 2021, 5:46:09 AM10/4/21
to vim...@googlegroups.com
hi,

On Mon, 4 Oct 2021 at 10:10, Julius Hamilton
<juliusha...@gmail.com> wrote:
> ... the end of line character “$”? ...

there is no "real" character, its conceptual, the end of line
"anchor". try 'cat file.txt' vs 'cat -A file.txt' for illustration.

--
regards, jr.

You have the right to free speech, as long as you're not dumb enough
to actually try it.
(The Clash 'Know Your Rights')

this email is intended only for the addressee(s) and may contain
confidential information. if you are not the intended recipient, you
are hereby notified that any use of this email, its dissemination,
distribution, and/or copying without prior written consent is
prohibited.
Reply all
Reply to author
Forward
0 new messages