Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fall back to locale's codec if codec is wrong
  • Loading branch information
elpaso committed Dec 3, 2021
1 parent b0e32b7 commit 808c994
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextfile.cpp
Expand Up @@ -92,8 +92,9 @@ bool QgsDelimitedTextFile::open()
mCodec = QTextCodec::codecForName( !mEncoding.isEmpty() ? mEncoding.toLatin1() : "UTF-8" );
if ( ! mCodec )
{
QgsDebugMsgLevel( "Data file " + mFileName + " could not be opened: wrong codec.", 2 );
return false;
QgsDebugMsgLevel( QStringLiteral( "Wrong codec '%1' for %2, falling back to locale default." ).arg( mEncoding, mFileName ), 2 );
mCodec = QTextCodec::codecForLocale( );
mEncoding = mCodec->name();
}
if ( mUseWatcher )
{
Expand Down

0 comments on commit 808c994

Please sign in to comment.