NPP_HexEdit icon indicating copy to clipboard operation
NPP_HexEdit copied to clipboard

Windows 1251 codepage

Open Homer83 opened this issue 1 year ago • 4 comments

Files in Windows-1251 charset HEX-Editor shows as UTF8 charser Original file in WinHEX Image

As it shown in HEX-Editor Image

Homer83 avatar Feb 11 '25 10:02 Homer83

@Homer83 Could you please provide the info from ?->Debug-Info for further analysis.

chcg avatar Mar 14 '25 15:03 chcg

I can confirm, one-byter in hex becomes utf-8

Notepad++ v8.6.8   (64-bit)
Build time : Jun  4 2024 - 00:30:00
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : C:\temp\scp21449\var\www\petelinsasha.ru\grav\user\config\plugins\shortcode-core.yaml
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 7 Professional (64-bit)
OS Build : 7601.0
Current ANSI codepage : 1251
Plugins : 
    BigFiles (0.1.3)
    ComparePlugin (2.0.2)
    helloworld (1)
    HexEditor (0.9.12)
    JSMinNPP (1.2205)
    MarkdownViewerPlusPlus (0.8.2)
    mimeTools (3.1)
    NppConverter (4.6)
    nppcrypt (1.0.1.6)
    NppExport (0.4)
    NppFTP (0.29.9)
    NppQrCode64 (0.0.0.1)
    ShtirlitzNppPlugin (1.1.2)
    XMLTools (3.1.1.13)

u07 avatar May 22 '25 05:05 u07

This must be the notepad itself - related. Steps to reproduce:

  1. Open 1-byte txt

Image

  1. Select another 1-byte codepage.

Image

  1. See wrong length - now it's unicoded internally. And HexEdit will use that unicoded data.

Image

u07 avatar May 22 '25 05:05 u07

Workaround: switch to one of the basic codepages which are Codepage=ANSI or Codepage=UTF8 before going to hex view. (ANSI is the very first item in the menu). I think this hack worth implementing in HexEdit code as the easiest solution, what do you think? Or you may try to find where is the real raw data is stored (and if it is modifiable), but if you modify it, NPP will have to re-endode...

u07 avatar May 22 '25 06:05 u07