code_junkie

How can I embed unicode string constants in a source file?

Nov 13th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. ///
  2. /// Protected: TestGetHebrewConfigString
  3. ///
  4. void CPrIniFileReaderTest::TestGetHebrewConfigString()
  5. {
  6. prwstring strHebrewTestFilePath = GetTestFilePath( strHebrewTestFileName );
  7. CPrIniFileReader prIniListReader( strHebrewTestFilePath.c_str() );
  8. prIniListReader.SetCurrentSection( strHebrewSubSection );
  9.  
  10. CPPUNIT_ASSERT( prIniListReader.GetConfigString( L"דונדארןמע" ) == L"דונהשךוק") );
  11. }
  12.  
  13. #define UNICODE_CONSTANT( CONSTANT ) towstring( CONSTANT )
  14.  
  15. wstring towstring( LPCSTR lpszValue )
  16. {
  17. wostringstream os;
  18. os << lpszValue;
  19. return os.str();
  20. }
  21.  
  22. CPPUNIT_ASSERT( prIniListReader.GetConfigString( UNICODE_CONSTANT( "דונדארןמע" ) ) == UNICODE_CONSTANT( "דונהשךוק" ) );
  23.  
  24. wchar_t *string = L"דונדארןמע";
  25.  
  26. wchar_t *string = "x05d3x05d5x05e0x05d3x05d0x05e8x05dfx05dex05e2";
Add Comment
Please, Sign In to add comment