java - Extracting the Charset Code of the Contents Area of Incoming Emails -


I am creating an email client program with javamail.

When an email is received, I want to send the sender's character code

I have successfully acquired all the header parts of the email and I have them in the database I can save.

Is there a way to remove only one pigment code that is attached to the content area of ​​the incoming email (i.e. alphabet = "iso-2022-jp") i am using regular expressions in java, but There is a different method to achieve this.

The pattern below is what I wrote but is unable to remove the code:

 > Pattern.compile    

If you are interested in regex, then you

  Pattern.compile ("text / (?: | | | Html); \\ S * charset \\ s * = \\ s * \ "([^ \"] +) \ "");   

This should store the encoding portion in group 1 so that you This pattern can be used like

  Matcher m = pattern.matcher (yourData); if (m.find ()) System.out.println (m.gr) Oup (1)); Other System.out.println ("no encoding notifications");    

Comments

  1. शुरुआत प्रोग्रामर के लिए जावा प्रोग्रामिंग नमूना कोड
    मल्टीपल इनहेरिटेंस जावा कोड उदाहरण

    ReplyDelete

Post a Comment

Popular posts from this blog

jasper reports - How to center align barcode using jasperreports and barcode4j -

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -