writing/reading chr[0-255]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

writing/reading chr[0-255]

#1 Post by Ed Dyreen » 14 Apr 2018 20:29

using this to write all characters out to separate files.

Code: Select all

:: --------------------------------------------------------------------------------------------------------------------------
echo. &echo. &<nul set /P = ¯ creating ASCII charMap[0-255]...
:: --------------------------------------------------------------------------------------------------------------------------
:: last updated       : 2015^04^12
:: support            : naDelayed
:: (
	2>nul MD "%$doskit.fullPath%\lib\charMap" &pushd "%$doskit.fullPath%\lib\charMap" &&(

		for /L %%i in (

			0, 1, 255

		) do 	if not exist "%%i.CHR" if %%i NEQ 26  (

			> "%%i.TMP" type NUL

			>nul makecab /D compress=OFF /D reserveperdatablocksize=26 /D reserveperfoldersize=%%i "%%i.TMP" "%%i.CHR"

			type %%i.CHR |(

				>nul ( for /L %%N in ( 1, 1, 38 ) do pause )

				> "%%i.TMP" findStr.EXE /BRIC:"^"
			)

			>nul copy /Y "%%i.TMP" /A "%%i.CHR" /B

			del /F /Q "%%i.TMP"

		) else 	>nul copy /Y NUL + NUL /A "%%i.CHR" /A

		popd
	)
:: )
>>"%$log.fullPathfile%" (echo.creating ASCII charMap[0-255] [ok:generated]) &echo. &<nul set /P = ® ASCII 0-255 [ok:generated]
:: --------------------------------------------------------------------------------------------------------------------------
The reading seems a bit more complex, I try to avoid per character tricks so my first attempt was something like

Code: Select all

	for /F usebackdelims^=^ eol^= %%r in ( "%~dp0\lib\charMap\8.CHR" ) do echo.setting bs &set "$bs=%%r"
	for /F usebackdelims^=^ eol^= %%r in ( "%~dp0\lib\charMap\13.CHR" ) do echo.setting cr &set "$cr=%%r"
That seems to work for backspace as I expected, but now carriage return is not loading. "setting cr" is never displayed, seems not possible to load characters directly using FOR.

The characters that I try to retrieve in a generic way are $bs, $tab, $lf, $cr, $sub and $esc


My god man, now I figure, can't even load a file containing a single tab without having to do something silly like

Code: Select all

>test (<nul set /P =	)
>test2 (<nul set /P =.)
copy /Y test + test2 /B "test3" /B

<test3 set /P "test="
set test

echo.endoftest
pause
exit
:shock:

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: writing/reading chr[0-255]

#2 Post by Ed Dyreen » 14 Apr 2018 22:25

A little closer

Code: Select all

setlocal enableDelayedExpansion

>nul copy /Y "doskitXPx86 v20180314\lib\charMap\13.CHR" + "doskitXPx86 v20180314\lib\charMap\8.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$bs=%%?"
echo. &set $bs
echo.this%$bs%works

>nul copy /Y "doskitXPx86 v20180314\lib\charMap\13.CHR" + "doskitXPx86 v20180314\lib\charMap\9.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$tab=%%?"
echo. &set $tab
echo.this%$tab%works

>nul copy /Y "doskitXPx86 v20180314\lib\charMap\13.CHR" + "doskitXPx86 v20180314\lib\charMap\13.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$cr=%%?"
echo. &set $cr
echo.this!$cr!works

>nul copy /Y "doskitXPx86 v20180314\lib\charMap\13.CHR" + "doskitXPx86 v20180314\lib\charMap\26.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$sub=%%?"
echo. &set $sub
echo.this%$sub%works

>nul copy /Y "doskitXPx86 v20180314\lib\charMap\13.CHR" + "doskitXPx86 v20180314\lib\charMap\27.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$esc=%%?"
echo. &set $esc
echo.this%$esc%works

echo.endoftest
pause
exit

Code: Select all

$bs=
thiworks


this    works

$cr=
works

→sub=
this→works

←esc=
this←works
endoftest
Druk op een toets om door te gaan. . .
the substitute character I needed to copy in ansi for some bizarre reason or the last char should not be stripped if copying in binary, very weird.

But it looks like this could work, now I don't need to use these silly per character creation tricks anymore...

the end goal would be to assign the decimal representation to $lf, $cr.... and then load all needed characters at once something like

Code: Select all

for %%? in ( $cr, $lf, ... ) do set decimalRepresentation = !%%?! &set %%? =< contents of !decimalRepresentation!.CHR

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: writing/reading chr[0-255]

#3 Post by aGerman » 15 Apr 2018 04:29

Generating the characters can be done using makecab as you already did.
viewtopic.php?f=3&t=5326

Reading and writing is more complicated. As jeb somewhen pointed out at least the NUL character can't be processed as text because cmd.exe is a C application where NUL is used as string terminator. So processing binary data can be done if you make a HEX dump. That's possible using FC or CERTUTIL. Writing a certain byte to a file can be done using COPY /B of the formerly created character files.

Steffen

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: writing/reading chr[0-255]

#4 Post by penpen » 15 Apr 2018 06:10

If you want to read characters 1 to 255 easily i would recommend to use codepage 850 (in which every ansii codepoint is defined), and create a table.dat file out of the single character files; if i see it right, then you don't use hex-filenames, so this might help you instead:

Code: Select all

>nul copy "32.chr" "table.dat"
for /l %%in in (1, 1, 255) do (>nul copy "table.dat" /b + "%%~i.chr" /b + "table.dat" /b)
Then you should have no problems loading all values (using codepage 850):

Code: Select all

set "table="
<"table.dat" set /p "table="
penpen

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: writing/reading chr[0-255]

#5 Post by Ed Dyreen » 15 Apr 2018 08:59

when I copy a file containing a sub + another file containing a sub in binary mode i get an output with only a single sub. But if i change output to ansi i get a file containing two sub characters ? But then ansi don't work for the other characters. using copy cr + cr in ansi gives a file with a single carriage return ?

Code: Select all

>nul copy /Y "26.CHR" + "26.CHR" /B "o.TMP" /B
for /F "usebackdelims=;eol=;" %%? in ( "o.TMP" ) do set "$sub=%%?"
echo. &set $sub
echo.this%$sub%works
pause
I thought binary meant, "exactly as is" I never figured why ansi would be needed as it seems limiting ?? but now with this behavior i understand even less.

@aGerman, yes I was not planning on loading the nul char, just trying to avoid loading the other special chars e.g. lf, cr, .. using tricks. the nul is just being written for completion. at some point in the future i am planning to make dos recognize weird characters in file names outside the codepage. so that all my media files are properly recognized when i pass them to VLC media player, but that's another problem i'll cover later...

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: writing/reading chr[0-255]

#6 Post by Ed Dyreen » 15 Apr 2018 10:42

loading a single character file which can contain any character form 1 to 255 seems not possible unless the file is first tested to see which character it actually contains. for example, a file containing a single tab cannot be loaded using <13.CHR set /P "$=" variable $ will be empty. Using for /F "usebackdelims=;eol=;" %%? in ( "charFile" ) do set "$=%%?" solves this but then FOR won't load substitute and carriage return.

characters 1 to 255 can be loaded correctly from a multichar file. This brings me to the following solution for the original problem "loading character files in a generic way in order to avoid having to use per character tricks"

chcp 850 is required in order for this to work correctly.

Code: Select all

>nul copy "%~dp0\lib\charMap\35.CHR" "%~dp0\lib\ASCII.table" &for /L %%i in ( 1, 1, 255 ) do (

	>nul copy "%~dp0\lib\ASCII.table" /B + "%~dp0\lib\charMap\%%i.CHR" /B "%~dp0\lib\ASCII.table" /B
)

set /A $bs	= 8
set /A $tab = 9
set /A $lf = 10
set /A $cr = 13
set /A $sub = 26
set /A $esc = 27

< "%~dp0\lib\ASCII.table" set /P "$ASCII.table=" &set $ASCII.table

setlocal enableDelayedExpansion

for %%? in (

	$bs, $tab, $lf, $cr, $sub, $esc

) do 	for %%i in ( !%%?! ) do (

	set "%%?=!$ASCII.table:~%%i,1!"
)

echo. &set $bs
echo.this%$bs%works
echo. &set $tab
echo.this%$tab%works
echo. &set $cr
echo.this!$cr!works
echo. &set $sub
echo.this%$sub%works
echo. &set $esc
echo.this%$esc%works

echo.endoftest
pause
exit

Code: Select all

$ASCII.table=#☺☻♥♦
♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡
«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²
■ 

$bs=
thiworks

$tab=
this    works

$cr=
works

$sub=→
this→works

$esc=←
this←works
endoftest
Druk op een toets om door te gaan. . .
The downside is that written like this delayedExpansion is required but it may be possible to remove this limitation.

Thanks for the quick helpful responses aGerman and penpen.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: writing/reading chr[0-255]

#7 Post by aGerman » 15 Apr 2018 13:14

Reading and writing HEX values might be easier.

Code: Select all

@echo off &setlocal DisableDelayedExpansion

:: ENCODE
>"plain.txt" echo Hello, World !!
certutil -f -encodehex "plain.txt" "hex.txt"

:: maybe "normalize" the output
set "f_in=hex.txt"
set "f_out=hex2.txt"
setlocal EnableDelayedExpansion

<"!f_in!" >"!f_out!" (
  for /f %%i in ('type "!f_in!"^|find /c /v ""') do for /l %%j in (1 1 %%i) do (
    set /p "line="
    for %%k in (!line:~5^,50!) do <nul set /p "=%%k "
  )
)

:: maybe manipulate values (e.g. remove the EOL characters)
<"hex2.txt" set /p "line="
set "line=!line:0d 0a =!"
>"hex2.txt" echo !line!

endlocal


:: DECODE
certutil -f -decodehex "hex2.txt" "plain2.txt"
pause
Steffen

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: writing/reading chr[0-255]

#8 Post by Ed Dyreen » 15 Apr 2018 14:28

aGerman wrote:
15 Apr 2018 13:14
Reading and writing HEX values might be easier.
It looks simpler and is probably preferred. By the time I've read your post I overcame the scope problem.

creating ASCII charMap[0-255]

Code: Select all

:: --------------------------------------------------------------------------------------------------------------------------
echo. &echo. &<nul set /P = ¯ creating ASCII charMap[0-255]...
:: --------------------------------------------------------------------------------------------------------------------------
:: last updated       : 2015^04^12
:: support            : naDelayed
:: (
	2>nul MD "%$doskit.fullPath%\lib\charMap" &pushd "%$doskit.fullPath%\lib\charMap" &&(

		for /L %%i in (

			0, 1, 255

		) do 	if not exist "%%i.CHR" if %%i NEQ 26  (

			> "%%i.TMP" type NUL

			>nul makecab /D compress=OFF /D reserveperdatablocksize=26 /D reserveperfoldersize=%%i "%%i.TMP" "%%i.CHR"

			type %%i.CHR |(

				>nul ( for /L %%N in ( 1, 1, 38 ) do pause )

				> "%%i.TMP" findStr.EXE /BRIC:"^"
			)

			>nul copy /Y "%%i.TMP" /A "%%i.CHR" /B

			del /F /Q "%%i.TMP"

		) else 	>nul copy /Y NUL + NUL /A "%%i.CHR" /A

		popd
	)
:: )
>>"%$log.fullPathfile%" (echo.creating ASCII charMap[0-255] [ok:generated]) &echo. &<nul set /P = ® ASCII 0-255 [ok:generated]
:: --------------------------------------------------------------------------------------------------------------------------
retrieving $bs, $tab, $lf, $cr, $sub, $esc

Code: Select all

:: --------------------------------------------------------------------------------------------------------------------------
echo. &echo. &<nul set /P = ¯ retrieving $bs, $tab, $lf, $cr, $sub, $esc...
:: --------------------------------------------------------------------------------------------------------------------------
:: (
	if not exist "%~dp0\lib\ASCII.table" (
		::
		>nul copy "%~dp0\lib\charMap\35.CHR" "%~dp0\lib\ASCII.table" &for /L %%i in ( 1, 1, 255 ) do (
			::
			>nul copy "%~dp0\lib\ASCII.table" /B + "%~dp0\lib\charMap\%%i.CHR" /B "%~dp0\lib\ASCII.table" /B
		)

	)

	< "%~dp0\lib\ASCII.table" set /P "$ASCII.table=" &echo. &echo. &set $ASCII.table
	set /A $bs = 8, $tab = 9, $lf = 10, $cr	= 13, $sub = 26, $esc = 27

	setlocal enableDelayedExpansion
	:: (
		for %%? in (

			$bs, $tab, $lf, $cr, $sub, $esc

		) do 	for %%i in ( !%%?! ) do (

			for /F tokens^=1-2^ delims^=#^ eol^=# %%r in ( "!$ASCII.table:~%%i,1!# " ) do (

				if "%%s" NEQ "" (

					endlocal &set "%%?=%%~r" &setlocal enableDelayedExpansion

				) else 	for %%r in ( "!$ASCII.table:~%%i,1!" ) do (

					endlocal &set "%%?=%%~r" &setlocal enableDelayedExpansion
				)
			)
		)
	:: )
	endlocal
:: )
>>"%$log.fullPathfile%" (echo.retrieving $bs, $tab, $lf, $cr, $sub, $esc [ok:loaded]) &echo. &<nul set /P = ® retrieving $bs, $tab, $lf, $cr, $sub, $esc [ok:loaded]
:: (
	setlocal enableDelayedExpansion
	:: (
		echo.
		echo. &set $bs
		echo.this%$bs%works
		echo. &set $tab
		echo.this%$tab%works
		echo. &set $lf
		echo.this!$lf!works
		echo. &set $cr
		echo.this!$cr!works
		echo. &set $sub
		echo.this%$sub%works
		echo. &set $esc
		echo.this%$esc%works
	:: )
	endlocal
:: )
:: --------------------------------------------------------------------------------------------------------------------------
::
goto :skip "()"
echo.endoftest
pause
exit
:skip ()

Code: Select all

 » creating ASCII charMap[0-255]...
 « ASCII 0-255 [ok:generated]

 » retrieving $bs, $tab, $lf, $cr, $sub, $esc...

$ASCII.table=#☺☻♥♦
♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡
«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²
■ 

 « retrieving $bs, $tab, $lf, $cr, $sub, $esc [ok:loaded]

$bs=
thiworks

$tab=
this    works

$lf=

this
works

$cr=
works

$sub=→
this→works

$esc=←
this←works
endoftest
Druk op een toets om door te gaan. . .
I'll test my own code first, I may change to yours more simpler solution when I start realigning the optional classes that deal with mapping dec and hex values, I have the charmap functions, was gonna take a look at them anyways, but you guys were so quick to respond.

Thanks !

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: writing/reading chr[0-255]

#9 Post by penpen » 15 Apr 2018 16:10

Ed Dyreen wrote:
15 Apr 2018 08:59
when I copy a file containing a sub + another file containing a sub in binary mode i get an output with only a single sub. But if i change output to ansi i get a file containing two sub characters ? But then ansi don't work for the other characters. using copy cr + cr in ansi gives a file with a single carriage return ?
This behaviour is explained very well on the microsoft technet page:
https://docs.microsoft.com/en-us/window ... mands/copy

Results (only tested exemplarily):

Code: Select all

:: "ASUBA.bin" == [A<SUB>A]
:: "BSUBB.bin" == [B<SUB>B]
>nul copy /Y [/A] "ASUBA.bin" [/A] + "BSUBB.bin" [/A] "o.TMP" [/A] & :: o.TMP == [AB<SUB>]
>nul copy /Y  /B  "ASUBA.bin"  /A  + "BSUBB.bin" [/A] "o.TMP" [/A] & :: o.TMP == [AB<SUB>]
>nul copy /Y [/A] "ASUBA.bin" [/A] + "BSUBB.bin"  /B  "o.TMP"  /A  & :: o.TMP == [AB<SUB>B<SUB>]
>nul copy /Y  /B  "ASUBA.bin"  /A  + "BSUBB.bin"  /B  "o.TMP"  /A  & :: o.TMP == [AB<SUB>B<SUB>]
>nul copy /Y [/A] "ASUBA.bin"  /B  + "BSUBB.bin"  /A  "o.TMP" [/A] & :: o.TMP == [A<SUB>AB<SUB>]
>nul copy /Y  /B  "ASUBA.bin" [/B] + "BSUBB.bin"  /A  "o.TMP" [/A] & :: o.TMP == [A<SUB>AB<SUB>]
>nul copy /Y [/A] "ASUBA.bin"  /B  + "BSUBB.bin" [/B] "o.TMP"  /A  & :: o.TMP == [A<SUB>AB<SUB>B<SUB>]
>nul copy /Y  /B  "ASUBA.bin" [/B] + "BSUBB.bin" [/B] "o.TMP"  /A  & :: o.TMP == [A<SUB>AB<SUB>B<SUB>]
>nul copy /Y [/A] "ASUBA.bin" [/A] + "BSUBB.bin" [/A] "o.TMP"  /B  & :: o.TMP == [AB]
>nul copy /Y  /B  "ASUBA.bin"  /A  + "BSUBB.bin" [/A] "o.TMP"  /B  & :: o.TMP == [AB]
>nul copy /Y [/A] "ASUBA.bin" [/A] + "BSUBB.bin"  /B  "o.TMP" [/B] & :: o.TMP == [AB<SUB>B]
>nul copy /Y  /B  "ASUBA.bin"  /A  + "BSUBB.bin"  /B  "o.TMP" [/B] & :: o.TMP == [AB<SUB>B]
>nul copy /Y [/A] "ASUBA.bin"  /B  + "BSUBB.bin"  /A  "o.TMP"  /B  & :: o.TMP == [A<SUB>AB]
>nul copy /Y  /B  "ASUBA.bin" [/B] + "BSUBB.bin"  /A  "o.TMP"  /B  & :: o.TMP == [A<SUB>AB]
>nul copy /Y [/A] "ASUBA.bin"  /B  + "BSUBB.bin" [/B] "o.TMP" [/B] & :: o.TMP == [A<SUB>AB<SUB>B]
>nul copy /Y  /B  "ASUBA.bin" [/B] + "BSUBB.bin" [/B] "o.TMP" [/B] & :: o.TMP == [A<SUB>AB<SUB>B]
penpen

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: writing/reading chr[0-255]

#10 Post by Ed Dyreen » 15 Apr 2018 17:54

penpen wrote:
15 Apr 2018 16:10
This behaviour is explained very well on the microsoft technet page:
https://docs.microsoft.com/en-us/window ... mands/copy
I disagree, I understand even less now OR I'm with stupid.

If a file containing only a single sub char + a file containing only a single sub char is being copied I don't wan't to see any EOF characters at all anywhere but I suspect that commands like <nul >destin set /P =%sub% insert an EOF char silently.

So I would expect reading them in ansi because we don't want EOF in the middle of our combined result file and then it should also write in ansi because otherwise our destin will be missing an eof char.

If my theory is correct then why does copy sub.chr /A + sub.chr /A destin /A results in a file containing:
1A
i was expecting
1A1A
yet copy cr.chr /A + cr.chr /A destin /A results in a file containing:
0D0D1A

I am beginning to believe looking at several sites that substitute character 1A = 26 actually IS CTRL^Z=EOF.
That would explain my confusion.

And I wonder why I even need an EOF char, I removed it so now my file contains just 0D0D and it seems to be readable by notepad just fine. This is for historical reasons ?

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: writing/reading chr[0-255]

#11 Post by penpen » 16 Apr 2018 05:20

Ed Dyreen wrote:
15 Apr 2018 17:54
If a file containing only a single sub char + a file containing only a single sub char is being copied I don't wan't to see any EOF characters at all anywhere
Ed Dyreen wrote:
15 Apr 2018 17:54
I am beginning to believe looking at several sites that substitute character 1A = 26 actually IS CTRL^Z=EOF.
That would explain my confusion.
Yes, the SUB character is the EOF character. If you copy it using binary copy, then you copy all file content, which includes the SUB == EOF character. So you end up with two SUB characters if you merge two files containing the SUB character using binary copy.
Ed Dyreen wrote:
15 Apr 2018 17:54
but I suspect that commands like <nul >destin set /P =%sub% insert an EOF char silently.
No, that command doesn't insert anything.
Ed Dyreen wrote:
15 Apr 2018 17:54
So I would expect reading them in ansi because we don't want EOF in the middle of our combined result file and then it should also write in ansi because otherwise our destin will be missing an eof char.
If our combined result wile is file the "ASCII.table", then we want the EOF character be part of the file at index 26.
Ed Dyreen wrote:
15 Apr 2018 17:54
If my theory is correct then why does copy sub.chr /A + sub.chr /A destin /A results in a file containing:
1A
i was expecting
1A1A
You are combining files, so the default copy mode is "/A" if this mode isn't set explicitely (wihch is the case).
If not combining files the binary mode is the default.
Empty places are filled with the actual mode, but there aren't any more in this case.
So your complete command is:
"copy /A sub.chr /A + sub.chr /A destin /A"

The first /A itself has onbly defines the mode for all following "empty mode definitions", but the next explicit "/A" or "/B" option overwrites that default.
The second /A defines the read mode for the first source file which is ansi/text mode.
That means all data preceding the first EOF character is written to the target file (nothing in this case).
The third /A defines the read mode for the second source file (same as above).
The mode for the target file also is /A, so after all files are copied an EOF character is appended.
Ed Dyreen wrote:
15 Apr 2018 17:54
And I wonder why I even need an EOF char, I removed it so now my file contains just 0D0D and it seems to be readable by notepad just fine. This is for historical reasons ?
Yes, it is; see:
https://en.wikipedia.org/wiki/Substitute_character#Uses


penpen

Post Reply