mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Tell Qt4 that we really meant Utf8 when we said Utf8
How strange. Telling Qt4 to assume that all C strings are Utf8 apparently isn't enough to convince tr() that the C strings we pass to it are Utf8. You need to set that codec separately. Fixes #503 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									084c2c04db
								
							
						
					
					
						commit
						7797926329
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -89,6 +89,9 @@ void init_ui(void) | ||||||
| 	// 106 is "UTF-8", this is faster than lookup by name
 | 	// 106 is "UTF-8", this is faster than lookup by name
 | ||||||
| 	// [http://www.iana.org/assignments/character-sets/character-sets.xml]
 | 	// [http://www.iana.org/assignments/character-sets/character-sets.xml]
 | ||||||
| 	QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106)); | 	QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106)); | ||||||
|  | 	// and for reasons I can't understand, I need to do the same again for tr
 | ||||||
|  | 	// even though that clearly uses C strings as well...
 | ||||||
|  | 	QTextCodec::setCodecForTr(QTextCodec::codecForMib(106)); | ||||||
| #ifdef Q_OS_WIN | #ifdef Q_OS_WIN | ||||||
| 	QFile::setDecodingFunction(decodeUtf8); | 	QFile::setDecodingFunction(decodeUtf8); | ||||||
| 	QFile::setEncodingFunction(encodeUtf8); | 	QFile::setEncodingFunction(encodeUtf8); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue