diff options
author | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 14:56:48 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 14:56:48 +0000 |
commit | b20d2bc2a6ab8c5c6bc030d179ed98e85866813c (patch) | |
tree | f326018fd9eb9d4bb0b8bbbe18d44d3900bd0221 | |
parent | e96943ca99f5dc1e669c896e58fc8357d449a944 (diff) | |
download | chromium_src-b20d2bc2a6ab8c5c6bc030d179ed98e85866813c.zip chromium_src-b20d2bc2a6ab8c5c6bc030d179ed98e85866813c.tar.gz chromium_src-b20d2bc2a6ab8c5c6bc030d179ed98e85866813c.tar.bz2 |
Call setlocale(LC_ALL, "") in a renderer process for subsequent calls to
SysNativeMBToWide and WideToSysNativeMB (that use mbstowcs and wcstombs) to
work correctly.
This is a clone of http://codereview.chromium.org/155913
BUG=16860 (http://crbug.com/16860 )
TEST=Run Chrome with LC_ALL=en_US.UTF-8 and try to upload a file whose name
contains non-ASCII characters in UTF-8 (e.g. "café.txt" or "一二.txt" ) . The filename field in a form should be populated with the name (rather than empty).
Review URL: http://codereview.chromium.org/159221
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21380 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/renderer_main_platform_delegate_linux.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/renderer/renderer_main_platform_delegate_linux.cc b/chrome/renderer/renderer_main_platform_delegate_linux.cc index 34e04d2..637f749 100644 --- a/chrome/renderer/renderer_main_platform_delegate_linux.cc +++ b/chrome/renderer/renderer_main_platform_delegate_linux.cc @@ -17,6 +17,9 @@ RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { } void RendererMainPlatformDelegate::PlatformInitialize() { + // To make wcstombs/mbstowcs work in a renderer. + const char* locale = setlocale(LC_ALL, ""); + LOG_IF(WARNING, locale == NULL) << "setlocale failed."; } void RendererMainPlatformDelegate::PlatformUninitialize() { |