mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 11:40:44 +08:00
one more fix with encoding when reading/writing XMLs
This commit is contained in:
parent
dc37ad803e
commit
6d05622a5f
@ -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, "<?xml version=\"1.0\"?>\n" );
|
||||
icvPuts( fs, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
|
||||
icvPuts( fs, "<opencv_storage>\n" );
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user