| 51 | #endif |
| 52 | |
| 53 | inline void OpenInputFile(std::ifstream& ifs, const std::string& path) { |
| 54 | #ifdef _WIN32 |
| 55 | std::wstring widePath; |
| 56 | if (Utf8ToWidePath(path, widePath)) { |
| 57 | ifs.open(widePath.c_str()); |
| 58 | return; |
| 59 | } |
| 60 | ifs.setstate(std::ios::failbit); |
| 61 | return; |
| 62 | #endif |
| 63 | ifs.open(path.c_str()); |
| 64 | } |
| 65 | |
| 66 | } // namespace cppjieba |
| 67 |