Giter Club home page Giter Club logo

Comments (3)

pedrinimm avatar pedrinimm commented on July 23, 2024

Why would you expect the correct encoding?

Your email doesn't have the conten-type header with no charset define?

Have you tried actually testing which charset is detected by the library and to which it tries to convert the content?

If you specify actually on your sample the utf-8 charset and the and the header, the parsing works
https://play.golang.com/p/M6A0RlQx_oE

from enmime.

jhillyerd avatar jhillyerd commented on July 23, 2024

Pedro is right, correctly encoded mail should contain charset encoding headers.

Enmime does attempt to use the chardet library to figure out character sets when possible:

enmime/part.go

Line 180 in ebd4cb3

// Attempt to detect character set from part content.

It may not have enough information to detect correctly here.

from enmime.

axllent avatar axllent commented on July 23, 2024

Thank you both, I think you have actually answered my question here - I just found https://www.w3.org/Protocols/rfc1341/7_1_Text.html which states The default Content-Type for Internet mail is "text/plain; charset=us-ascii" (I assumed this was UTF8). Sorry for the "issue", I'll mark this as resolved, thanks again :)

from enmime.

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.