-Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
-===================================================================
---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1546)
-+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
-@@ -713,6 +713,39 @@
- return ms;
- }
-
-+/* GCSEOAdaptorChannel protocol */
-+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \
-+ @" c_name VARCHAR (256) NOT NULL,\n"
-+ @" c_content VARCHAR (100000) NOT NULL,\n"
-+ @" c_creationdate INT4 NOT NULL,\n"
-+ @" c_lastmodified INT4 NOT NULL,\n"
-+ @" c_version INT4 NOT NULL,\n"
-+ @" c_deleted INT4 NULL\n"
-+ @")");
-+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
-+ @" c_uid VARCHAR (256) NOT NULL,\n"
-+ @" c_object VARCHAR (256) NOT NULL,\n"
-+ @" c_role VARCHAR (80) NOT NULL\n"
-+ @")");
-+
-+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
-+{
-+ NSString *sql;
-+
-+ sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
-+
-+ return [self evaluateExpressionX: sql];
-+}
-+
-+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
-+{
-+ NSString *sql;
-+
-+ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
-+
-+ return [self evaluateExpressionX: sql];
-+}
-+
- @end /* PostgreSQL72Channel */
-
- @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
-Index: sope-gdl1/Oracle8/GNUmakefile
-===================================================================
---- sope-gdl1/Oracle8/GNUmakefile (révision 1546)
-+++ sope-gdl1/Oracle8/GNUmakefile (copie de travail)
-@@ -28,15 +28,23 @@
- SOPE_ROOT=../..
- ORACLE_VERSION=10.2.0.3
- #ORACLE_VERSION=11.1.0.1
--ADDITIONAL_INCLUDE_DIRS += -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
-+ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
-
-+local_arch = $(subst 64,,$(shell uname -m))
-+
-+ifeq ($(local_arch),ppc)
-+PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++
-+else
-+PPC_LDFLAGS=
-+endif
-+
- ifneq ($(frameworks),yes)
--Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
--otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
-+common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -L../GDLAccess/obj -lGDLAccess -L../../sope-core/EOControl/obj -lEOControl $(PPC_LDFLAGS)
- else
--Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
--otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
-+common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS)
- endif
-+Oracle8_BUNDLE_LIBS += $(common_LIBS)
-+otest_TOOL_LIBS += $(common_LIBS)
-
- # Bundle
- BUNDLE_NAME = Oracle8
-Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m
-===================================================================
---- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1546)
-+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail)
-@@ -53,14 +53,17 @@
- while (c--)
- {
- info = [[_row_buffer objectAtIndex: c] pointerValue];
-- [_row_buffer removeObjectAtIndex: c];
-
- // We free our LOB object. If it fails, it likely mean it isn't a LOB
- // so we just free the value instead.
-- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
-- {
-- free(info->value);
-- }
-+ if (info->value)
-+ {
-+ if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
-+ free(info->value);
-+ info->value = NULL;
-+ }
-+ free(info);
-+ [_row_buffer removeObjectAtIndex: c];
- }
-
- OCIHandleFree(_current_stm, OCI_HTYPE_STMT);
-@@ -75,6 +78,30 @@
- //
- @implementation OracleAdaptorChannel
-
-+static void
-+DBTerminate()
-+{
-+ if (OCITerminate(OCI_DEFAULT))
-+ NSLog(@"FAILED: OCITerminate()");
-+ else
-+ NSLog(@"Oracle8: environment shut down");
-+}
-+
-++ (void) initialize
-+{
-+ // We Initialize the OCI process environment.
-+ if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0,
-+ (dvoid * (*)(dvoid *, size_t)) 0,
-+ (dvoid * (*)(dvoid *, dvoid *, size_t))0,
-+ (void (*)(dvoid *, dvoid *)) 0 ))
-+ NSLog(@"FAILED: OCIInitialize()");
-+ else
-+ {
-+ NSLog(@"Oracle8: environment initialized");
-+ atexit(DBTerminate);
-+ }
-+}
-+
- - (id) initWithAdaptorContext: (EOAdaptorContext *) theAdaptorContext
- {
- if ((self = [super initWithAdaptorContext: theAdaptorContext]))
-@@ -134,10 +161,14 @@
- NSLog(@"FAILED: OCILogoff()");
- }
-
-- if (OCITerminate(OCI_DEFAULT))
-- {
-- NSLog(@"FAILED: OCITerminate()");
-- }
-+
-+ OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
-+ OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
-+ // OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
-+
-+ _oci_ctx = (OCISvcCtx *)0;
-+ _oci_err = (OCIError *)0;
-+ _oci_env = (OCIEnv *)0;
- }
- }
-
-@@ -151,11 +182,6 @@
- [self _cleanup];
-
- RELEASE(_resultSetProperties);
--
-- OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
-- OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
-- OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
--
- RELEASE(delegate);
-
- [super dealloc];
-@@ -368,16 +394,7 @@
- return NO;
- }
-
-- // We Initialize the OCI process environment.
-- if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0,
-- (dvoid * (*)(dvoid *, size_t)) 0,
-- (dvoid * (*)(dvoid *, dvoid *, size_t))0,
-- (void (*)(dvoid *, dvoid *)) 0 ))
-- {
-- NSLog(@"FAILED: OCIInitialize()");
-- return NO;
-- }
--
-+
- if (OCIEnvInit((OCIEnv **)&_oci_env, (ub4)OCI_DEFAULT, (size_t)0, (dvoid **)0))
- {
- NSLog(@"FAILED: OCIEnvInit()");
-Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m
-===================================================================
---- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1546)
-+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail)
-@@ -155,7 +155,9 @@
- OCILobFreeTemporary([theChannel serviceContext], [theChannel errorHandle], info->value);
- OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB);
- }
-+ free(info);
- }
-+ [theColumns release];
-
- OCIHandleFree(theStatement, OCI_HTYPE_STMT);
- }
Index: sope-mime/NGImap4/NGImap4Connection.m
===================================================================
---- sope-mime/NGImap4/NGImap4Connection.m (révision 1546)
+--- sope-mime/NGImap4/NGImap4Connection.m (révision 1548)
+++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail)
@@ -381,7 +381,7 @@
[self errorWithFormat:@"Could not list mailbox hierarchy!"];
Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m
===================================================================
---- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1546)
+--- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1548)
+++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail)
@@ -648,14 +648,13 @@
enumerator = [_flags objectEnumerator];
if (objs) free(objs);
Index: sope-mime/NGImap4/NGImap4ResponseParser.m
===================================================================
---- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1546)
+--- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1548)
+++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail)
@@ -84,6 +84,8 @@
static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
{
Index: sope-mime/NGMail/NGSmtpClient.m
===================================================================
---- sope-mime/NGMail/NGSmtpClient.m (révision 1546)
+--- sope-mime/NGMail/NGSmtpClient.m (révision 1548)
+++ sope-mime/NGMail/NGSmtpClient.m (copie de travail)
@@ -442,10 +442,10 @@
[self->text flush];
reply = [self receiveReply];
Index: sope-mime/NGMail/NGMimeMessageGenerator.m
===================================================================
---- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1546)
+--- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1548)
+++ sope-mime/NGMail/NGMimeMessageGenerator.m (copie de travail)
@@ -86,37 +86,40 @@
char *des = NULL;
unsigned isoEndLen = 2;
Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m
===================================================================
---- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1546)
+--- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1548)
+++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail)
@@ -285,24 +285,16 @@
- (id)parseValue:(id)_data ofHeaderField:(NSString *)_field {
bytes++;
Index: sope-mime/NGMime/NGMimeBodyPart.m
===================================================================
---- sope-mime/NGMime/NGMimeBodyPart.m (révision 1546)
+--- sope-mime/NGMime/NGMimeBodyPart.m (révision 1548)
+++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail)
@@ -31,18 +31,6 @@
return 2;
- (NSString *)contentId {
Index: sope-mime/NGMime/NGMimeBodyParser.m
===================================================================
---- sope-mime/NGMime/NGMimeBodyParser.m (révision 1546)
+--- sope-mime/NGMime/NGMimeBodyParser.m (révision 1548)
+++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail)
@@ -67,7 +67,10 @@
if (_data == nil) return nil;
Index: sope-mime/NGMime/NGMimePartParser.h
===================================================================
---- sope-mime/NGMime/NGMimePartParser.h (révision 1546)
+--- sope-mime/NGMime/NGMimePartParser.h (révision 1548)
+++ sope-mime/NGMime/NGMimePartParser.h (copie de travail)
@@ -117,6 +117,7 @@
BOOL parserParseRawBodyDataOfPart:1;
@interface NSObject(NGMimePartParser)
Index: sope-mime/NGMime/NGMimePartParser.m
===================================================================
---- sope-mime/NGMime/NGMimePartParser.m (révision 1546)
+--- sope-mime/NGMime/NGMimePartParser.m (révision 1548)
+++ sope-mime/NGMime/NGMimePartParser.m (copie de travail)
@@ -227,7 +227,7 @@
}
: [NGMimeType mimeType:[ctype stringValue]];
Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m
===================================================================
---- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1546)
+--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1548)
+++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (copie de travail)
@@ -49,80 +49,70 @@
}
return data;
}
+Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
+===================================================================
+--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1548)
++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
+@@ -713,6 +713,39 @@
+ return ms;
+ }
+
++/* GCSEOAdaptorChannel protocol */
++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \
++ @" c_name VARCHAR (256) NOT NULL,\n"
++ @" c_content VARCHAR (100000) NOT NULL,\n"
++ @" c_creationdate INT4 NOT NULL,\n"
++ @" c_lastmodified INT4 NOT NULL,\n"
++ @" c_version INT4 NOT NULL,\n"
++ @" c_deleted INT4 NULL\n"
++ @")");
++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
++ @" c_uid VARCHAR (256) NOT NULL,\n"
++ @" c_object VARCHAR (256) NOT NULL,\n"
++ @" c_role VARCHAR (80) NOT NULL\n"
++ @")");
++
++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
++{
++ NSString *sql;
++
++ sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
++
++ return [self evaluateExpressionX: sql];
++}
++
++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
++{
++ NSString *sql;
++
++ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
++
++ return [self evaluateExpressionX: sql];
++}
++
+ @end /* PostgreSQL72Channel */
+
+ @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m
===================================================================
---- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1546)
+--- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1548)
+++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (copie de travail)
@@ -140,8 +140,12 @@
}
static char *iconv_wrapper(id self, char *_src, unsigned _srcLen,
+Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h
+===================================================================
+--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1548)
++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (copie de travail)
+@@ -19,6 +19,8 @@
+ 02111-1307, USA.
+ */
+
++#include <libxml/encoding.h>
++
+ #include <SaxObjC/SaxXMLReader.h>
+ #include <SaxObjC/SaxLexicalHandler.h>
+ #include <SaxObjC/SaxDeclHandler.h>
+Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m
+===================================================================
+--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1548)
++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (copie de travail)
+@@ -30,6 +30,12 @@
+ #include <libxml/HTMLparser.h>
+ #include <libxml/HTMLtree.h>
+
++@interface NSObject (contentHandlerExtensions) <SaxContentHandler>
++
++- (xmlCharEncoding) contentEncoding;
++
++@end
++
+ @interface libxmlHTMLSAXDriver(PrivateMethods)
+
+ - (void)tearDownParser;
+@@ -205,6 +211,7 @@
+
+ - (void)setupParserWithDocumentPath:(NSString *)_path {
+ xmlSAXHandler sax;
++ xmlCharEncoding charEncoding;
+
+ if (self->ctxt != NULL) {
+ NSLog(@"WARNING(%s): HTML parser context already setup !",
+@@ -223,14 +230,18 @@
+ __PRETTY_FUNCTION__, self, activeDriver);
+ }
+ activeDriver = self;
+-
++
++ if ([self->contentHandler respondsToSelector: @selector (contentEncoding)])
++ charEncoding = [self->contentHandler contentEncoding];
++ else
++ charEncoding = XML_CHAR_ENCODING_8859_1;
++
+ self->ctxt = htmlCreatePushParserCtxt(&sax /* sax */,
+ NULL /*self*/ /* userdata */,
+ NULL /* chunk */,
+ 0 /* chunklen */,
+ [_path cString] /* filename */,
+- XML_CHAR_ENCODING_8859_1
+- /* encoding */);
++ charEncoding /* encoding */);
+ self->doc = NULL;
+ }
+ - (void)tearDownParser {
Index: sope-appserver/NGObjWeb/GNUmakefile.postamble
===================================================================
---- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1546)
+--- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1548)
+++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail)
@@ -23,14 +23,20 @@
-endif
Index: sope-appserver/NGObjWeb/WOContext.m
===================================================================
---- sope-appserver/NGObjWeb/WOContext.m (révision 1546)
+--- sope-appserver/NGObjWeb/WOContext.m (révision 1548)
+++ sope-appserver/NGObjWeb/WOContext.m (copie de travail)
@@ -64,11 +64,13 @@
static BOOL testNSURLs = NO;
serverURL = [@"http://" stringByAppendingString:host];
Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m
===================================================================
---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1546)
+--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1548)
+++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail)
@@ -216,6 +216,12 @@
assocCount++;
Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m
===================================================================
---- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1546)
+--- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1548)
+++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail)
@@ -40,6 +40,7 @@
WOAssociation *string;
return YES;
Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h
===================================================================
---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1546)
+--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1548)
+++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail)
@@ -41,7 +41,8 @@
WOAssociation *pageName;
/* 'ivar' associations */
Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m
===================================================================
---- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1546)
+--- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1548)
+++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail)
@@ -39,22 +39,34 @@
static int debugLookup = -1;
Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m
===================================================================
---- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1546)
+--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1548)
+++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail)
@@ -31,6 +31,7 @@
#include <NGObjWeb/WOCookie.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
+#import <Foundation/NSKeyValueCoding.h>
+#import <Foundation/NSValue.h>
+
#import <SaxObjC/SaxAttributes.h>
#import <SaxObjC/SaxContentHandler.h>
#import <SaxObjC/SaxLexicalHandler.h>
#import <NGExtensions/NSString+misc.h>
#import <NGObjWeb/SoObjects.h>
+#include <libxml/encoding.h>
+
#import "UIxMailPartHTMLViewer.h"
#if 0
BOOL inCSSDeclaration;
BOOL hasEmbeddedCSS;
NSMutableArray *crumb;
+ xmlCharEncoding contentEncoding;
}
- (NSString *) result;
css = nil;
result = nil;
attachmentIds = nil;
+ contentEncoding = XML_CHAR_ENCODING_UTF8;
}
return self;
[super dealloc];
}
+- (void) setContentEncoding: (xmlCharEncoding) newContentEncoding
+{
+ contentEncoding = newContentEncoding;
+}
+
+- (xmlCharEncoding) contentEncoding
+{
+ return contentEncoding;
+}
+
- (void) setAttachmentIds: (NSDictionary *) newAttachmentIds
{
attachmentIds = newAttachmentIds;
return attachmentIds;
}
+- (xmlCharEncoding) _xmlCharsetForCharset: (NSString *) charset
+{
+ struct { NSString *name; xmlCharEncoding encoding; } xmlEncodings[] = {
+ { @"us-ascii", XML_CHAR_ENCODING_NONE},
+ { @"utf-8", XML_CHAR_ENCODING_UTF8},
+ { @"utf-16le", XML_CHAR_ENCODING_UTF16LE},
+ { @"utf-16be", XML_CHAR_ENCODING_UTF16BE},
+ { @"ucs-4le", XML_CHAR_ENCODING_UCS4LE},
+ { @"ucs-4be", XML_CHAR_ENCODING_UCS4BE},
+ { @"ebcdic", XML_CHAR_ENCODING_EBCDIC},
+// { @"iso-10646" , XML_CHAR_ENCODING_UCS4_2143},
+// { , XML_CHAR_ENCODING_UCS4_3412},
+// { @"ucs-2", XML_CHAR_ENCODING_UCS2},
+ { @"iso8859_1", XML_CHAR_ENCODING_8859_1},
+ { @"iso-8859-1", XML_CHAR_ENCODING_8859_1},
+ { @"iso-8859-2", XML_CHAR_ENCODING_8859_2},
+ { @"iso-8859-3", XML_CHAR_ENCODING_8859_3},
+ { @"iso-8859-4", XML_CHAR_ENCODING_8859_4},
+ { @"iso-8859-5", XML_CHAR_ENCODING_8859_5},
+ { @"iso-8859-6", XML_CHAR_ENCODING_8859_6},
+ { @"iso-8859-7", XML_CHAR_ENCODING_8859_7},
+ { @"iso-8859-8", XML_CHAR_ENCODING_8859_8},
+ { @"iso-8859-9", XML_CHAR_ENCODING_8859_9},
+ { @"iso-2022-jp", XML_CHAR_ENCODING_2022_JP},
+// { @"iso-2022-jp", XML_CHAR_ENCODING_SHIFT_JIS},
+ { @"euc-jp", XML_CHAR_ENCODING_EUC_JP},
+ { @"us-ascii", XML_CHAR_ENCODING_ASCII}};
+ unsigned count;
+ xmlCharEncoding encoding;
+
+ encoding = XML_CHAR_ENCODING_NONE;
+ count = 0;
+
+ while (encoding == XML_CHAR_ENCODING_NONE
+ && count < (sizeof (xmlEncodings) / sizeof (xmlEncodings[0])))
+ if ([charset isEqualToString: xmlEncodings[count].name])
+ encoding = xmlEncodings[count].encoding;
+ else
+ count++;
+
+ if (encoding == XML_CHAR_ENCODING_NONE)
+ encoding = XML_CHAR_ENCODING_8859_1;
+
+ return encoding;
+}
+
+- (xmlCharEncoding) _xmlCharEncoding
+{
+
+ NSString *charset;
+
+ charset = [[bodyInfo objectForKey:@"parameterList"]
+ objectForKey: @"charset"];
+ if (![charset length])
+ charset = @"us-ascii";
+
+ return [self _xmlCharsetForCharset: [charset lowercaseString]];
+}
+
- (void) _parseContent
{
- id <NSObject, SaxXMLReader> parser;
+ NSObject <SaxXMLReader> *parser;
NSData *preparsedContent;
preparsedContent = [super decodedFlatContent];
parser = [[SaxXMLReaderFactory standardXMLReaderFactory]
createXMLReaderForMimeType: @"text/html"];
+ [parser setValue: [NSNumber numberWithBool: NO]
+ forKey: @"encodeEntities"];
handler = [_UIxHTMLMailContentHandler new];
[handler setAttachmentIds: [self _attachmentIds]];
+ [handler setContentEncoding: [self _xmlCharEncoding]];
[parser setContentHandler: handler];
[parser parseFromSource: preparsedContent];
}