brrond / sscpfe

Super Simple Command Prompt File Editor (sscpfe). File editing utility like nano, but exclusively for Windows. Written in C#.
BSD 3-Clause Clear License
2 stars 0 forks source link

Add -e option to binary reading #5

Open brrond opened 1 year ago

brrond commented 1 year ago

Add encoding selection option to binary reading

It is really good idea to add encoding selection option to binary reading functionality. Here some example: Second part is win1251 encoded

---------------------------------------------------------------------------
|    addr|                                         values|            char|
|-------------------------------------------------------------------------|
|00000000|53 6F 6D 65 20 74 65 78 74 20 68 65 72 65 20 61|Some text here a|
|00000010|6E 64 20 74 68 65 72 65 0D 0A 61 6E 64 20 6D 6F|nd there..and mo|
|00000020|72 65 20 74 65 78 74 20 6F 6E 20 74 68 69 73 20|re text on this |
|00000030|6C 69 6E 65 0D 0A 3F 20 3F 3F 3F 3F 3F 20 3F 3F|line..? ????? ??|
|00000040|3F 3F 20 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 20 3F|?? ??????????? ?|
|00000050|3F 3F 3F 3F 2C 20 3F 3F 3F 3F 3F 3F 3F 3F 20 3F|????, ???????? ?|
|00000060|20 3F 20 3F 3F 3F 3F 3F 3F 3F                  | ? ???????      |
---------------------------------------------------------------------------

Note:

Because addr and values part of the table can't be changed it's only possible to change char column. The best idea is to make it less character width (not 16 but 8 for example). ASCII = 8byte, UTF-16 = 16byte (twice less characters).