Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After translating a piece of text from UTF-8 to GBK encoding, the original characters still remain. #9

Open
ln12347 opened this issue May 17, 2024 · 3 comments

Comments

@ln12347
Copy link

ln12347 commented May 17, 2024

After translating a piece of text from UTF-8 to GBK encoding, the original characters still remain.
image

@ln12347
Copy link
Author

ln12347 commented May 17, 2024

IntelliJ IDEA 2023.3 (Ultimate Edition)
Build #IU-233.11799.241, built on December 2, 2023
macbook pro m3

@ln12347
Copy link
Author

ln12347 commented May 17, 2024

In the GBK format, the character in the last position should not be displayed. It seems that this might be difficult to implement, which may be why each character is displayed, leading to what appears to be garbled text occupying the position.

@hajdam
Copy link
Member

hajdam commented May 17, 2024

Hi,
I believe this is just misunderstanding of how hex editors work. Hex editor is not text editor as it works with raw binary data and it has just a text preview where for each byte position a single character is decoded.

This means that as it works by design for multi-byte character sets/encodings (applies to both UTF-8 and GBK) you should not expect a coherent text / character sequence in preview.

BinEd provides editable string sequence decoder in parsing panel which decodes short text from current cursor position.

obrazek

In contrast example of decoding from second byte which would be invalid in text editor / in the middle of first character:

obrazek

I'm not aware if there are some hex editors which would provide better approach to this / there could be maybe added some dynamic mode with preview generated from current cursor position, but I have no plans for that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants