View Single Post
  #71  
Old June 25th 18, 03:17 PM posted to alt.comp.os.windows-10
Mayayana
external usenet poster
 
Posts: 6,438
Default Reading an .ini file with Notepad using Windows 10

"Chris" wrote

| Colored text is formatting, not plain text.
|
| I don't think you understand what syntax highlighting is and what it's
| for...
|

I've written my own editor for HTML and VBS.
My editor has more functionality and better syntax
color highlighting than Notepad++.

www.jsware.net/jsware/webed.php5

I also wrote a javascript de-obfuscator that does
a better job of "prettifying" javascript than
Notepad++ does, using only VBScript and HTML.

www.jsware.net/jsware/scrfiles.php5#jsdeob

To quote Walter Brennan, "no brag, just fact". I've
designed my editor and deobfuscator for specific
languages. Notepad++ is mediocre by design. It
sacrifices specialization in order to support numerous
languages. One size fits all.

So, yes, I do know what syntax highlighting is.

[For anyone who doesn't, it just refers to colorcoding
programming code text for clarity. Comments in one
color. Keywords in another. Etc.]

| It is not coloured text. It is a highlight. Coloured text, just like
| italics/bold, would be encoded in the saved file and would be retained
| regardless of which editor got opened it with. A highlight is an aid for
| understanding the content/language that the text is written in.
|

No, it doesn't work that way. That's what I was trying
to explain. You're seeing the editor only in terms of your
particular use for it. You see the color highlighting for
what it means to you.

That's like saying one gold bracelet
is a metal ring while another is a decoration for women.
They're both exactly the same thing. You're just defining
them differently in your usage. The first one is merely
1/2 ounce of gold. The second is a gorgeous piece of
jewelry that cost you "an arm and a leg" and expresses
your dedication to your girlfriend or wife. What you're
saying is tantamount to saying your gold bracelet is
not metal. For you it might *represent* getting laid, but
it's still made out of "plain old" metal.

Or again, it's like saying that writing Happy Birthday
red in Wordpad is different from coloring a keyword red in
your code editor. The difference is only that your code
editor doesn't save the color encoding metadata when
it saves the file. It could. But that's not relevant for
your usage, so it doesn't.

Your editor has to be a word processor in order to show
you those colors. That's to say, a plain text editor can't
show colors. That's why I said a code editor is like a 3rd
category. It's a word processor with limitations, that opens
and saves only plain text but offers word processor functionality.
The formatting it does is only in the editor window. It then
drops the formatting data when it saves the file out. But
that formatting has to be metadata encoding of some kind.
That is, word processing. Your code editor doesn't have
little red flashlights inside to highlight words, just because
you use it for code writing.

| Conversely, a word processor will somehow save
| formatting information in the file. An RTF file or a
| DOC file contain the text plus images, font property
| markers, etc.
|
| Exactly. Except a text file is usually ASCII not ANSI.
|

That's another common misconception. ASCII is
a standard set of characters represented by byte
values 0-127. ANSI uses byte values 0-255. Bytes
to 127 are the same as ASCII. Bytes 128+ are
interpeted depending on your computer setup. Your
computer uses a "codepage" that interprets those
bytes in accord with the default language you've
chosen.
If you speak English your computer will use codepage
1033 and character 255 will look like a small y with
an umlaut. If you speak Russian you'll have the Cyrillic
codepage and character 255 will look like a backward
R. If you add a copyright symbol to your "ASCII" file
it's ANSI. If you look at how Notepad will save a file
you won't see ASCII. You'll only see ANSI because no
one has stored text as 7-bit values for a long time.

Some Linux fanatics like to say ANSI is nonsense
because Linux now uses UTF-8 by default for plain
text and codepages are a Windows thing. But that's
an ignorant brag. UTF-8 is a fairly recent solution
for internationalization.
ANSI has served for many years to allow plain text
to remain as 1 byte=1 character and still adapt to
non-Western-Euro languages. UTF-8 is also ASCII
for the first 128 byte values. So in many cases,
for English/Western text files, ASCII, ANSI and UTF-8
are identical. They can only be distinguished by looking
at bytes over 127 to see whether they conform to
ANSI or UTF-8.

| Whether an editor can do something like
| reformat to specific line lengths is a text function,
| not a word processor function.
|
| Yes, because it only works with fixed-width fonts and counts the columns.
| Word processors can use variable width fonts which don't line up in
| columns.
|

Wrong again. Sorry, but you're extrapolating
inaccurately from your own specific experience.
There's no requirement for fixed-width fonts
in counting columns. You may like the columns
to line up, but that's neither here nor there.

Open your favorite code editor using a wedding
invitation font. It should still show you what column
you click on when you click the mouse in the editor.
In fact, with Notepad++ I can assign numerous
fonts. Wedding invitation for keywords, comic Sans
for plain text... I prefer Verdana for coding, which is
also not mono-spaced.



Ads