Bug 1493418 - nsThebesFontEnumerator needs to convert font names from UTF-8 (not Latin-1) to UTF-16. r=lsalzman
authorJonathan Kew <jkew@mozilla.com>
Sat, 22 Sep 2018 23:29:22 +0100
changeset 437815 ed4b9b12e32a0063490dbefd78b6835d7b0e4dd3
parent 437814 0b11e726fe9c5a1c347a870464b04587743f9d0d
child 437816 ce09c255d21724626724200464bd4b034901682f
push id108161
push userjkew@mozilla.com
push dateSat, 22 Sep 2018 22:29:56 +0000
treeherdermozilla-inbound@ed4b9b12e32a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1493418
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1493418 - nsThebesFontEnumerator needs to convert font names from UTF-8 (not Latin-1) to UTF-16. r=lsalzman
gfx/src/nsThebesFontEnumerator.cpp
--- a/gfx/src/nsThebesFontEnumerator.cpp
+++ b/gfx/src/nsThebesFontEnumerator.cpp
@@ -241,17 +241,17 @@ nsThebesFontEnumerator::GetDefaultFont(c
         return NS_ERROR_INVALID_ARG;
     }
 
     *aResult = nullptr;
     nsAutoCString defaultFontName(gfxPlatform::GetPlatform()->
         GetDefaultFontName(nsDependentCString(aLangGroup),
                            nsDependentCString(aGeneric)));
     if (!defaultFontName.IsEmpty()) {
-        *aResult = ToNewUnicode(defaultFontName);
+        *aResult = UTF8ToNewUnicode(defaultFontName);
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsThebesFontEnumerator::UpdateFontList(bool *_retval)
 {
     gfxPlatform::GetPlatform()->UpdateFontList();
@@ -274,11 +274,11 @@ nsThebesFontEnumerator::GetStandardFamil
 
     nsAutoCString family;
     gfxPlatform::GetPlatform()->
         GetStandardFamilyName(NS_ConvertUTF16toUTF8(aName), family);
     if (family.IsEmpty()) {
         *aResult = nullptr;
         return NS_OK;
     }
-    *aResult = ToNewUnicode(family);
+    *aResult = UTF8ToNewUnicode(family);
     return NS_OK;
 }