source: npl/overig/libvmime/vmime-mixed-qp-in-parameter.diff @ 5160d62

perl-5.22
Last change on this file since 5160d62 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 882 bytes
RevLine 
[c5c522c]1Index: svn/src/parameter.cpp
2===================================================================
3--- svn/src/parameter.cpp       (revision 597)
4+++ svn/src/parameter.cpp       (working copy)
5@@ -239,8 +239,21 @@
6                        {
7                                value << t.getWholeBuffer();
8 
9-                               if (!foundCharsetChunk)
10-                                       ch = t.getWordAt(0)->getCharset();
11+                               if (!foundCharsetChunk) {
12+                                       // this is still wrong. each word can have it's
13+                                       // own charset, and can be mixed (eg. iso-8859-1
14+                                       // and iso-2022-jp), but very unlikely.
15+                                       // real fix is to have parameters store a
16+                                       // vmime::text in stead of a vmime::word in
17+                                       // m_value.  but that changes the interface
18+                                       for (size_t i = 0; i < t.getWordCount(); i++) {
19+                                               if (t.getWordAt(i)->getCharset() != ch && ch == charsets::US_ASCII) {
20+                                                       ch = t.getWordAt(i)->getCharset();
21+                                                       break;
22+                                               }
23+                                       }
24+                                               
25+                               }
26                        }
27                }
28        }
Note: See TracBrowser for help on using the repository browser.