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

libmime normalizeCharset RTF charset code replace #294

Open
chenxiaoba opened this issue Jul 5, 2021 · 2 comments
Open

libmime normalizeCharset RTF charset code replace #294

chenxiaoba opened this issue Jul 5, 2021 · 2 comments

Comments

@chenxiaoba
Copy link

chenxiaoba commented Jul 5, 2021

Hello,

libmime normalizeCharset would normalize 136 to iso-8859-136, but actually it's RTF charset big5.
Can libmime normalizeCharset replace 136 to big5 and 134 to gb2312?

Many thanks.

@chenxiaoba chenxiaoba changed the title libmime RTF charset libmime RTF charset code replace Jul 5, 2021
@chenxiaoba chenxiaoba changed the title libmime RTF charset code replace libmime normalizeCharset RTF charset code replace Jul 5, 2021
@andris9
Copy link
Member

andris9 commented Jul 5, 2021

Could you provide samples for testing? Eg a simple email message that uses these encodings for text content?

@chenxiaoba
Copy link
Author

chenxiaoba commented Sep 27, 2021

For example,

if string charset is 136, it would display as wrong string. Because 136 is replaced to iso-8859-136.

libmime.decodeWords("Subject: =?136?Q?=B4=FA=B8=D5?=")
// output: "Subject: ����"

But if it charset is big5, it can display correctly.

libmime.decodeWords("Subject: =?big5?Q?=B4=FA=B8=D5?=");
// output: "Subject: 測試"

Because the number 136 mean big5 in RTF. In Wiki there is a list compare between "RTF Character Set" and "Code Page".
https://en.wikipedia.org/wiki/Rich_Text_Format#Character_encoding

Many thanks again.

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