• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28531 (tree)
Time2019-03-13 06:20:22
Authorstefankueng

Log Message

replace std::codecvt_utf8 with calls to MultibyteToWideChar/WideCharToMultibyte since C++17 does not have std::codecvt_utf8 anymore.

Change Summary

Incremental Difference

--- trunk/src/ResText/ResModule.cpp (revision 28530)
+++ trunk/src/ResText/ResModule.cpp (revision 28531)
@@ -1,7 +1,7 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
33 // Copyright (C) 2015-2019 - TortoiseGit
4-// Copyright (C) 2003-2008, 2010-2017 - TortoiseSVN
4+// Copyright (C) 2003-2008, 2010-2017, 2019 - TortoiseSVN
55
66 // This program is free software; you can redistribute it and/or
77 // modify it under the terms of the GNU General Public License
@@ -2291,17 +2291,16 @@
22912291 // now try the same with the file treated as utf16
22922292 {
22932293 // open as a byte stream
2294- std::wifstream wfin(fullpath, std::ios::binary);
2294+ std::ifstream wfin(fullpath, std::ios::binary);
22952295 // apply BOM-sensitive UTF-16 facet
2296- wfin.imbue(std::locale(wfin.getloc(), new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
22972296 //std::wifstream wfin(fullpath);
2298- std::wstring wfile_line;
2299- while (std::getline(wfin, wfile_line))
2297+ std::string file_line;
2298+ while (std::getline(wfin, file_line))
23002299 {
2301- auto defpos = wfile_line.find(L"#define");
2300+ auto defpos = file_line.find("#define");
23022301 if (defpos != std::wstring::npos)
23032302 {
2304- std::wstring text = wfile_line.substr(defpos + 7);
2303+ std::wstring text = CUnicodeUtils::StdGetUnicode(file_line.substr(defpos + 7));
23052304 trim(text);
23062305 auto spacepos = text.find(' ');
23072306 if (spacepos == std::wstring::npos)
Show on old repository browser