Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: runtime/bin/platform_win.cc

Issue 2785073002: [dart:io] Adds Platform.localeName (Closed)
Patch Set: Fixup ddc patch file Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/platform_unsupported.cc ('k') | sdk/lib/_internal/js_runtime/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_win.cc
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
index 18526517e9ff2bd72c742d36a6a46bfdd3d30805..8ec32d24e1d9c23cf1d493f5dc3e2689692eab76 100644
--- a/runtime/bin/platform_win.cc
+++ b/runtime/bin/platform_win.cc
@@ -198,6 +198,16 @@ const char* Platform::LibraryExtension() {
}
+const char* Platform::LocaleName() {
+ wchar_t locale_name[LOCALE_NAME_MAX_LENGTH];
+ int result = GetUserDefaultLocaleName(locale_name, LOCALE_NAME_MAX_LENGTH);
+ if (result == 0) {
+ return NULL;
+ }
+ return StringUtilsWin::WideToUtf8(locale_name);
+}
+
+
bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
#if defined(DART_IO_DISABLED) || defined(PLATFORM_DISABLE_SOCKET)
return false;
« no previous file with comments | « runtime/bin/platform_unsupported.cc ('k') | sdk/lib/_internal/js_runtime/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698