Browse Source

[apple-port] Format locales for Apple (#1485)

Conversions on Apple didn't work. That's because the locales are
formatted a bit differently. This alters the codepage to locale
conversion in WinAdapter on Apple to conform to their practices
Greg Roth 7 năm trước cách đây
mục cha
commit
7269f3b1be
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      lib/DxcSupport/WinAdapter.cpp

+ 5 - 0
lib/DxcSupport/WinAdapter.cpp

@@ -53,8 +53,13 @@ void CAllocator::Free(void *p) throw() { free(p); }
 //===---------------------- Char converstion ------------------------------===//
 
 const char *CPToLocale(uint32_t CodePage) {
+#ifdef __APPLE__
+  static const char *utf8 = "en_US.UTF-8";
+  static const char *iso88591 = "en_US.ISO8859-1";
+#else
   static const char *utf8 = "en_US.utf8";
   static const char *iso88591 = "en_US.iso88591";
+#endif
   if (CodePage == CP_UTF8) {
     return utf8;
   } else if (CodePage == CP_ACP) {