mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 06:26:37 +00:00 
			
		
		
		
	To follow https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#sf21-dont-use-an-unnamed-anonymous-namespace-in-a-header Add QtGlobal include to define QT_VERSION and QT_VERSION_CHECK macroses before they're used.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			482 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			482 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef OPENMW_COMPONENTS_MISC_UTF8QTEXTSTREAM_HPP
 | |
| #define OPENMW_COMPONENTS_MISC_UTF8QTEXTSTREAM_HPP
 | |
| 
 | |
| #include <QtGlobal>
 | |
| 
 | |
| #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
 | |
| #include <QTextCodec>
 | |
| #endif
 | |
| #include <QTextStream>
 | |
| 
 | |
| namespace Misc
 | |
| {
 | |
|     inline void ensureUtf8Encoding(QTextStream& stream)
 | |
|     {
 | |
| #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
 | |
|         stream.setCodec(QTextCodec::codecForName("UTF-8"));
 | |
| #else
 | |
|         stream.setEncoding(QStringConverter::Utf8);
 | |
| #endif
 | |
|     }
 | |
| }
 | |
| #endif
 |