microsoft / vscode-hexeditor

VS Code Hex Editor
https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor
MIT License
525 stars 85 forks source link

add common cjk encoding (gb18030 for simple Chinese, big5 for traditional Chinese, euc-kr for Korean, euc-jp for Japanese) datatype support #465

Closed liudonghua123 closed 7 months ago

liudonghua123 commented 10 months ago

Closes https://github.com/microsoft/vscode-hexeditor/issues/464.

lramos15 commented 10 months ago

I do worry that this will make the data inspector fairly long. I wonder if there's a way we can support all the formats that the TextDecoder supports without adding a bunch of these

liudonghua123 commented 10 months ago

I do worry that this will make the data inspector fairly long. I wonder if there's a way we can support all the formats that the TextDecoder supports without adding a bunch of these

Yeah, an interactive select element which includes all supported encoding of TextDecoder as options maybe an elegant way.

However, the datatype decode is quick and low resource consumption. And there are a lot remaining free spaces there, so maybe not a problem right now.

HaxtonFale commented 10 months ago

Could you please also add Shift-JIS? I believe it's pretty common in a lot of JP executables.

liudonghua123 commented 10 months ago

Could you please also add Shift-JIS? I believe it's pretty common in a lot of JP executables.

@HaxtonFale Hi, do you means shift-jis is more popular and widely used then euc-jp, if only one encoding for Japanese is choosed here, do you prefer to use shift-jis in your opinion?

liudonghua123 commented 10 months ago

From the docs on Encodings of Japanese. It seems shift-jis is more suitable then euc-jp. I will update the code for pr.

And for Korean, iso-2022-kr seems more suitable then euc-kr, from https://www.rfc-editor.org/rfc/rfc1557.html.

Young-Lord commented 7 months ago

IMHO, maybe it would be better to allow users to customize encoding(s) to use in configuration file? 或者说,从配置文件读取需要的编码是否会更好?