GithubHelp home page GithubHelp logo

Comments (10)

ziahamza avatar ziahamza commented on September 28, 2024

Should it be considered a bug as this could be properly handled in the TryParseMailbox

from mimekit.

jstedfast avatar jstedfast commented on September 28, 2024

Yea, this is a bug... I'll look into it.

from mimekit.

jstedfast avatar jstedfast commented on September 28, 2024

Mono supports cp936 (aka gb2312) and cp54936 (aka gb18030), but, as you noted, does not support cp51936 (aka euc-cn) nor cp52936 (aka hz-gb-2312).

So... what to do?

You probably know more about this than I do... so, if 51936 doesn't exist on the system, should it try falling back to 936? Or should it try 54936? or will neither of those work as a fallback?

Same for 52936... how should that fall back?

from mimekit.

ziahamza avatar ziahamza commented on September 28, 2024

I personally dont have experience in chinese. I happen to live in Hong Kong so I regularly get mails in this encoding. I guess falling back to 936 seems like the correct choice to do until mono gets full support for those encodings, and I think it should work for most characters.

from mimekit.

ziahamza avatar ziahamza commented on September 28, 2024

But thats a guess from my side as I cant read chinese

from mimekit.

ziahamza avatar ziahamza commented on September 28, 2024

firefox apparently fall backs to gb18030 which was then reported as a bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=844082

from mimekit.

ziahamza avatar ziahamza commented on September 28, 2024

and they plan to change it to GBK (gb2312) which is also what you propose.

from mimekit.

jstedfast avatar jstedfast commented on September 28, 2024

Awesome discovery, thanks!

from mimekit.

ziahamza avatar ziahamza commented on September 28, 2024

should it be pushed back in the mono runtime or just a fix in MimeKit? Other programs could benifit automatically if its pushed upstream

from mimekit.

jstedfast avatar jstedfast commented on September 28, 2024

Well, System.Text.Encoding doesn't make any guarantees about what encodings it supports, so I don't think it's necessarily something that should be pushed down into Mono.

The TryParseMailbox() code should not have assumed that the codepage it got existed (although it should generally be safe to make that assumption...), so I added a try/catch around it. The encoding, at that point, is only needed to set on the MailboxAddress anyway.

I also fixed up CharsetUtils's charset mapping tables (this is how TryParseMailbox() got the correct codepage even when the system didn't support it).

from mimekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.