From f8f505fde447285a8bbada769e02fc75cb9cc2f6 Mon Sep 17 00:00:00 2001 From: Terry Mancey Date: Fri, 19 Apr 2019 02:12:29 +0100 Subject: [PATCH] Fix Ads locale on Windows fixes https://github.com/brave/brave-browser/issues/4172 --- components/brave_ads/browser/ads_service_impl.cc | 2 ++ components/brave_ads/browser/locale_helper_win.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/brave_ads/browser/ads_service_impl.cc b/components/brave_ads/browser/ads_service_impl.cc index bc69ebb1d8c2..64e2d9541e70 100644 --- a/components/brave_ads/browser/ads_service_impl.cc +++ b/components/brave_ads/browser/ads_service_impl.cc @@ -334,6 +334,8 @@ void AdsServiceImpl::OnMaybeStartForRegion( is_supported_region_ = is_supported_region; if (!is_supported_region_) { + LOG(WARNING) << GetAdsLocale() << " locale does not support Ads"; + Shutdown(); return; } diff --git a/components/brave_ads/browser/locale_helper_win.cc b/components/brave_ads/browser/locale_helper_win.cc index 210be2e08152..982128988bf6 100644 --- a/components/brave_ads/browser/locale_helper_win.cc +++ b/components/brave_ads/browser/locale_helper_win.cc @@ -34,7 +34,7 @@ std::string LocaleHelperWin::GetLocale() const { wcstombs(locale.get(), locale_name.get(), size); - return std::string(locale.get(), size); + return std::string(locale.get()); } LocaleHelperWin* LocaleHelperWin::GetInstance() {