From 6d05622a5f5fcd169c0fcedf0e78652e9f16e5d7 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Sat, 21 May 2011 09:03:04 +0000 Subject: [PATCH] one more fix with encoding when reading/writing XMLs --- modules/core/src/persistence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index 12dfc3b790..b92d5458f7 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -2149,7 +2149,7 @@ icvXMLParse( CvFileStorage* fs ) }*/ { const char* encoding = cvAttrValue( list, "encoding" ); - if( encoding && strcmp( encoding, "ASCII" ) != 0 ) + if( encoding && strcmp( encoding, "ASCII" ) != 0 && strcmp( encoding, "UTF-8" ) != 0 ) CV_PARSE_ERROR( "Unsupported encoding" ); } @@ -2651,7 +2651,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags ) fs->strstorage = cvCreateChildMemStorage( fs->memstorage ); if( !append || file_size == 0 ) { - icvPuts( fs, "\n" ); + icvPuts( fs, "\n" ); icvPuts( fs, "\n" ); } else