Skip to content
Permalink
Browse files

styles: explictly save symbol XML in UTF-8 (fixes #9045)

  • Loading branch information
jef-n committed Feb 12, 2014
1 parent 65bf9ac commit 44885511ff71b2aa9f5b0648de331430313fd8e2
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/symbology-ng/qgsstylev2.cpp
@@ -119,6 +119,7 @@ bool QgsStyleV2::saveSymbol( QString name, QgsSymbolV2* symbol, int groupid, QSt

QByteArray xmlArray;
QTextStream stream( &xmlArray );
stream.setCodec( "UTF-8" );
symEl.save( stream, 4 );
char *query = sqlite3_mprintf( "INSERT INTO symbol VALUES (NULL, '%q', '%q', %d);",
name.toUtf8().constData(), xmlArray.constData(), groupid );
@@ -222,6 +223,7 @@ bool QgsStyleV2::saveColorRamp( QString name, QgsVectorColorRampV2* ramp, int gr

QByteArray xmlArray;
QTextStream stream( &xmlArray );
stream.setCodec( "UTF-8" );
rampEl.save( stream, 4 );
char *query = sqlite3_mprintf( "INSERT INTO colorramp VALUES (NULL, '%q', '%q', %d);",
name.toUtf8().constData(), xmlArray.constData(), groupid );
@@ -390,6 +392,7 @@ bool QgsStyleV2::save( QString filename )
return false;
}
QTextStream ts( &f );
ts.setCodec( "UTF-8" );
doc.save( ts, 2 );
f.close();
#endif
@@ -1029,6 +1032,7 @@ int QgsStyleV2::addSmartgroup( QString name, QString op, QgsSmartConditionMap co

QByteArray xmlArray;
QTextStream stream( &xmlArray );
stream.setCodec( "UTF-8" );
smartEl.save( stream, 4 );
char *query = sqlite3_mprintf( "INSERT INTO smartgroup VALUES (NULL, '%q', '%q')",
name.toUtf8().constData(), xmlArray.constData() );
@@ -1318,6 +1322,7 @@ bool QgsStyleV2::exportXML( QString filename )
}

QTextStream ts( &f );
ts.setCodec( "UTF-8" );
doc.save( ts, 2 );
f.close();

@@ -1427,6 +1432,7 @@ bool QgsStyleV2::updateSymbol( StyleEntity type, QString name )
QDomElement symEl;
QByteArray xmlArray;
QTextStream stream( &xmlArray );
stream.setCodec( "UTF-8" );

char *query;

0 comments on commit 4488551

Please sign in to comment.
You can’t perform that action at this time.