Skip to content

Commit ee5093e

Browse files
authored
Apple's filesystem uses UTF-8 encoding.
1 parent 448264f commit ee5093e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Support/ConvertUTFWrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,16 @@ bool convertGBKToUTF8String(StringRef SrcGBK, std::string &Out) {
268268
// Apple's filesystem uses UTF-8 encoding.
269269
Out = SrcGBK.str();
270270
return true;
271-
#elif defined(_WIN32)
271+
#else
272+
#if defined(_WIN32)
272273
const char *GBKLocalName = ".936";
273274
#else
274275
const char *GBKLocalName = "zh_CN.GBK";
275276
#endif
276-
277277
std::filesystem::path Path{SrcGBK.str(), std::locale(GBKLocalName)};
278278
Out = Path.u8string();
279279
return true;
280+
#endif
280281
}
281282

282283
static_assert(sizeof(wchar_t) == 1 || sizeof(wchar_t) == 2 ||

0 commit comments

Comments
 (0)