Re: Tutorial: Notepad++ shortcuts.xml macro converts unicode to the 95-keyboard ASCII characters
Marian <[email protected]>
| Newsgroups | alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
R.Wieser wrote:
> Odd though : you have posted the standard macros, as if you have not tested
> your "the essential trio" conclusion yourself ...
Thanks for looking at the code, which was designed to convert the most
common "funky" characters found in web site copy pasted text to only the 95
or so characters found on a typical US QWERTY keyboard.
When I tested the "essential trio", I didn't realize it missed some (like
copyright, trademark, degrees, etc.), so I posted an update replacing the
trio with the half dozen.
So I agree with you that the essential trio was posted before I was
positive it worked in all cases - which it didn't - so I replaced it.
> Also, replacing something with itself doesn't really do much. :-)
I'm not sure what you mean by that since the replacement is to change
Unicode characters (for the most part) into 7-bit ASCII characters.
So, in the sense that a curly quote is changed to a regular quote, you
could argue it's replacing itself, but in reality it's a different
character.
If you're on the Android newsgroup, you'll see more clearly why it matters.
We've had a discussion about charset Usenet headers in recent days.
>
> And a hint : make sure that all indentation is correct before hitting the
> "send" button. Seeing the "action" lines having four different indentations
> looks ugly. Same for wrapping replace-blocks (those 6 lines you spoke of)
> with empty lines. Either do it everywhere, or do it nowhere.
Good point. That's my actual code so I didn't clean it up for presentation.
> And I almost forgot : You need to be carefull when replacing special chars
> with phrases. You might have better results when wrapping the phrases with
> spaces ( see "->" and "deg")
Yeah. Thanks. The degree I struggled with bothering with since gVIM can
handle the degree but I wanted to be consistent in removing all the common
characters which are found in copy-pasted web sites that's not on the
keyboard.
There's no "arrow" or "degree" symbol on the keyboard.
> And I noticed while walking thru that list :
> " " is a thin space, not an "x".
> "&#151;" to "&" ? Not a dash ?
> '"' with single-quotes around it instead of double ones ? Any reason
> for that ?
> "apos;" ? Why not just a single quote thats available on you keyboard ?
> " " is a hard space, not a quote.
> "‘" and "’" are twice in there.
> "*" is a standard ASCII char ("*"). Why not use it instead ?
Thank you for making those wonderful suggestions.
I'll take them each on their own merits in a moment, as I appreciate the
help, not only for me, but for everyone as we all can use this sanitizer.