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

Japanese text coded in GB2312 are garbled. #4282

Open
totake0224 opened this issue Oct 10, 2024 · 6 comments
Open

Japanese text coded in GB2312 are garbled. #4282

totake0224 opened this issue Oct 10, 2024 · 6 comments

Comments

@totake0224
Copy link
Contributor

totake0224 commented Oct 10, 2024

Hi.
I got garbled mail that coded in GB2312 included Japanese text in it.
my freescout version is 1.8.115 PHP 8.1.2
and NEW_FETCHING_LIBRARY is false
I could not reproduce this type of email by myself so it difficult to debug this.
I would appreciate if this problem will be fixed.

1,How it looks when garbled.(second sentence of body text)
image
2,How it should look.
image
3.How it looks in the original code of the email(excerpted from mail source)
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=A4=A4=A4=C4=A4=E2=A4=AA=CA=C0=D4=92=A4=CB=A4=CA=A4=C3=A4=C6=A4=AA=A4=EA=A4=
=DE=A4=B9=A1=A3
=D3=F9=D2=8A=B7e=A4=AA=EE=8A=A4=A4=D6=C2=A4=B7=A4=DE=A4=B9=A1=A3

In addition to this. mail subject is also encoded in GB2312 but it looks decoded correctly.

@freescout-help
Copy link
Collaborator

Try to send a sample EML file to [email protected]

@freescout-help
Copy link
Collaborator

freescout-help commented Oct 10, 2024

Is it decoded correctly when viewing it in your mail provider's client outside of FreeScout?

@totake0224
Copy link
Contributor Author

Thunderbird decoded correctly on same mail.
I send sample email to support@.
and I found some information about this issue.
a site I found on internet said,
iconv -f GB18030 -t UTF8
works fine on GB2312 encoded Japanese mail.
but I could not try it because I could not reproduce gb2312 mail.

@freescout-help
Copy link
Collaborator

freescout-help commented Oct 11, 2024

Try to add the following code to the line 755 in https://github.com/freescout-help-desk/freescout/blob/dist/overrides/webklex/php-imap/src/Message.php#L755

        if (strtolower($from) == 'gb2312'){
           $from = 'gb18030';
        }

After that try to do this: https://github.com/freescout-help-desk/freescout/wiki/Fetching-Emails#checking-eml-file

@totake0224
Copy link
Contributor Author

Thank you.
and I'm sorry I did not know about cheking-eml method.
I will use this by myself.but just now my version of freescout bit older and it need some effort to update it to current version. so it need time to use this. but I will do it and report the result. please give some time.

@totake0224
Copy link
Contributor Author

Hi,
I had confirmed 'gb18030' decoded my eml file properly at base version 1.8.154.
I think it better way under Japanese environment. but I could not said same at Chinese environment.
but to be honest. I'm glad if this code will be in release.

By the way
please add notice about parse-eml's arguments at
https://github.com/freescout-help-desk/freescout/wiki/Fetching-Emails#checking-eml-file
it needs time to find out it's usage.
php artisan freescout:parse-eml --mailbox=YOUR-MAILBOX-ID

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