ASCII Box drawing characters forcing me to use alternative text editor
-
@guy038 said in ASCII Box drawing characters forcing me to use alternative text editor:
Paste the text below, in this new tab
+1, for the box-drawing character diagrams alone! :-)
I think there is going to be “more to the story” of the OP’s workflow, than is workable by Guy’s description, if the OP ever feels responsive.
BTW, more good discussion along these “codepage 437” lines is found from 4 years ago.
-
All,
I am not sure @TroshinDV’s point was. Windows-1251, which was what I think that user showed, is not the same as Windows-1252, which was mentioned earlier (as a character set that does not contain boxdrawing characters). And looking at Windows-1251 list of characters at Wikipedia, I don’t see any box-drawing characters there, either.
When one types characters that don’t exist in a given encoding, the results can vary, depending on circumstances. But with pure-8bit encodings like OEM-US (437) or Windows-1252 or Windows-1251, you can only encode 256 characters, so it cannot encode characters that aren’t in that character set – so once you’ve saved it, it is limited to those 256 bytes, and when it reloads, assuming it’s still recognized as the same encoding, all those bytes will be interpreted in the context of that encoding. Since the box drawing characters aren’t in 1251 or 1252, it’s not going to be effective to try to type them in a file encoded in 1251 or 1252, because there is no byte that 1251 or 1252 will interpret as a box-drawing character.
Back to the OP’s question: Based on my understanding of the OP’s description, there exists a file that already encodes box-drawing characters in an 8-bit encoding – and given his mention of “ASCII box drawing characters” and “PC DOS”, my best bet is that they are encoded in CP-437/OEM-US. Notepad++ doesn’t always auto-recognize this; as I said earlier: if you can change the extension, then using
.nfo
will convince Notepad++ to default to the right encoding; if there is a unique extension for the file, you can add that as a user-extension in the “Dos style” Style Configurator entry, so that Notepad++ will treat that new extension as “Dos style” as well, and assume the right encoding; or, if it’s an extension like.txt
that cannot be guaranteed to always be box-drawing, then I recommend a keyboard shortcut mapped to the OEM-US menu selection, to make it easy. -
@PeterJones file from https://community.notepad-plus-plus.org/post/62317 after save and reopen.
it looks like Windows operates on other characters when alt + a combination of numbers.
badly.
I would like to have symbols for drawing tables in 1251 … -
And I already wanted to write a script in javascript for a jN plugin that draws a table by pressing Alt + (arrows). :)
-
скопировал текст из
https://community.notepad-plus-plus.org/post/62316Very strange behavior. Bug?
-
-
@guy038 @Alan-Kilborn @PETERJONES @TroshinDV
I know this is an old post. I want to thank you all for explaining why it happens.My situation is a bit rare. I’m using a slightly modified telnet client to access a database engine. This client was designed in the Windows-XP era and the developers seemed to do as little as possible to it to keep it functional as the OS progressed.
It is a x86 distribution, they distribute their own Windows font with it, and they use ascii line drawing symbols to represent on screen forms.
See examples below. The example is not a good one, because some of the developer portions of the interface use many more box segments.
New document -> Convert to UTF-8-BOM and even selecting the vendor supplied font does not produce the line drawings.
I understand this is probably a case of new vs old. Or perhaps if I uninstall the 64 bit version and hunt down a 32 bit version that would work?
A screen snip from the client program:
Pasting into [cough] NoteTab Pro
Pasting into Notepad++
-
If I type those characters in an OEM-US (the boxdrawing code page), Notepad++ does just fine with them. If I copy/paste from the OEM-US tab to a UTF-8-BOM tab, they still look right.
┌───────────┐ │ │ ├─────┬─────┤ │ │ │ ├─────┼─────┤ │ │ │ ├─────┴─────┤ │ │ └───────────┘
Looking at the bytes in my files after saving:
C:\usr\local\apps\npp\npp.8.2.2-RC1.portable.x64>xxd oem-us.txt 00000000: dac4 c4c4 c4c4 c4c4 c4c4 c4c4 bf0d 0ab3 ................ 00000010: 2020 2020 2020 2020 2020 20b3 0d0a c3c4 ..... 00000020: c4c4 c4c4 c2c4 c4c4 c4c4 b40d 0ab3 2020 .............. 00000030: 2020 20b3 2020 2020 20b3 0d0a c3c4 c4c4 . ....... 00000040: c4c4 c5c4 c4c4 c4c4 b40d 0ab3 2020 2020 ............ 00000050: 20b3 2020 2020 20b3 0d0a c3c4 c4c4 c4c4 . ......... 00000060: c1c4 c4c4 c4c4 b40d 0ab3 2020 2020 2020 .......... 00000070: 2020 2020 20b3 0d0a c0c4 c4c4 c4c4 c4c4 ........... 00000080: c4c4 c4c4 d90d 0a ....... C:\usr\local\apps\npp\npp.8.2.2-RC1.portable.x64>xxd utf8bom.txt 00000000: efbb bfe2 948c e294 80e2 9480 e294 80e2 ................ 00000010: 9480 e294 80e2 9480 e294 80e2 9480 e294 ................ 00000020: 80e2 9480 e294 80e2 9490 0d0a e294 8220 ............... 00000030: 2020 2020 2020 2020 2020 e294 820d 0ae2 ...... 00000040: 949c e294 80e2 9480 e294 80e2 9480 e294 ................ 00000050: 80e2 94ac e294 80e2 9480 e294 80e2 9480 ................ 00000060: e294 80e2 94a4 0d0a e294 8220 2020 2020 ........... 00000070: e294 8220 2020 2020 e294 820d 0ae2 949c ... ........ 00000080: e294 80e2 9480 e294 80e2 9480 e294 80e2 ................ 00000090: 94bc e294 80e2 9480 e294 80e2 9480 e294 ................ 000000a0: 80e2 94a4 0d0a e294 8220 2020 2020 e294 ......... .. 000000b0: 8220 2020 2020 e294 820d 0ae2 949c e294 . .......... 000000c0: 80e2 9480 e294 80e2 9480 e294 80e2 94b4 ................ 000000d0: e294 80e2 9480 e294 80e2 9480 e294 80e2 ................ 000000e0: 94a4 0d0a e294 8220 2020 2020 2020 2020 ....... 000000f0: 2020 e294 820d 0ae2 9494 e294 80e2 9480 .............. 00000100: e294 80e2 9480 e294 80e2 9480 e294 80e2 ................ 00000110: 9480 e294 80e2 9480 e294 80e2 9498 0d0a ................
So, given the characters you are showing from your copy paste into Notepad++, I think what you need to do is to is to
- New file
- Set to Encoding > Character Set > Western > OEM-US
- Paste boxdrawing clipboard into the file
- Save
- Encoding > Convert to UTF-8-BOM
- Save
When I followed those steps exactly, I got the same thing in the final file as I showed in my utf8bom.txt above.
Addendum: Alternately, if your new file is set to Language > MSDOS style, it will automatically choose OEM-US, and it will want to save as xxx.nfo, and the bytes will be the same as before. But once you convert to UTF-8-BOM, you should save with a different extension, so that Notepad++ will stop trying to coerce it into boxdrawing MSDOS-style.
Edit: I had incorrectly called OEM-US character set something else originally; I went back and fixed it all.
Addendum 2: All this is basically a repeat of what I said a year ago. Apparently, I am not capable of explaining such things in a way you understand. Sorry. But now I’m worried you will again not understand.
-
Well, catch me running down the the street shouting “give me a towel”
Or… Eureka.
I just realize I was adjusting the wrong setting for font.
I was working with global override when I should have modified Default Style
-
@gregory-g Happy Birthday, post about ASCII Box drawing!