Skip to content

Commit

Permalink
add default UTF-8 encoding to grass provider by default
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Oct 19, 2020
1 parent 390384c commit fb11887
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassfeatureiterator.cpp
Expand Up @@ -743,7 +743,7 @@ QgsGrassFeatureSource::QgsGrassFeatureSource( const QgsGrassProvider *p )
, mGrassType( p->mGrassType )
, mQgisType( p->mQgisType )
, mFields( p->fields() )
, mEncoding( p->textEncoding() )
, mEncoding( p->textEncoding() ) // no copying - this is a borrowed pointer from Qt
, mEditing( p->mEditBuffer )
{
Q_ASSERT( mLayer );
Expand Down
4 changes: 4 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -250,6 +250,10 @@ QgsGrassProvider::QgsGrassProvider( const QString &uri )
// << QgsVectorDataProvider::NativeType( tr( "Date" ), "date", QVariant::Date, 8, 8 );
);

// Assign default encoding
if ( !textEncoding() )
QgsVectorDataProvider::setEncoding( QStringLiteral( "UTF-8" ) );

mValid = true;

QgsDebugMsg( QString( "New GRASS layer opened, time (ms): %1" ).arg( time.elapsed() ) );
Expand Down

0 comments on commit fb11887

Please sign in to comment.