tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit bc9abeb392e20e634cf5c1953a530ff211857424
parent 81582e34d299d48c7237e4d24a4ffc07e24500bf
Author: Chris Peterson <cpeterson@mozilla.com>
Date:   Wed,  8 Oct 2025 16:01:42 +0000

Bug 1992592 - Replace u8"" string literals in nsAlertsIconListener. r=saschanaz

u8"" strings have type const char[] in C++17, but type const char8_t[] in C++20. Since most Firefox code is written assuming char or char16_t strings, char8_t strings cause type mismatches that would require additional overloads or string conversions.

Because Firefox .cpp files are compiled as UTF-8, "" string literals are already UTF-8 encoded and the explicit u8 prefix is unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D267905

Diffstat:
Mtoolkit/system/gnome/nsAlertsIconListener.cpp | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp @@ -400,13 +400,13 @@ nsresult nsAlertsIconListener::InitAlertAsync(nsIAlertNotification* aAlert, CopyUTF16toUTF8(text, mAlertText); if (gBodySupportsMarkup) { NS_ENSURE_TRUE( - mAlertText.ReplaceSubstring(u8"&"_ns, u8"&amp;"_ns, mozilla::fallible), + mAlertText.ReplaceSubstring("&"_ns, "&amp;"_ns, mozilla::fallible), NS_ERROR_FAILURE); NS_ENSURE_TRUE( - mAlertText.ReplaceSubstring(u8"<"_ns, u8"&lt;"_ns, mozilla::fallible), + mAlertText.ReplaceSubstring("<"_ns, "&lt;"_ns, mozilla::fallible), NS_ERROR_FAILURE); NS_ENSURE_TRUE( - mAlertText.ReplaceSubstring(u8">"_ns, u8"&gt;"_ns, mozilla::fallible), + mAlertText.ReplaceSubstring(">"_ns, "&gt;"_ns, mozilla::fallible), NS_ERROR_FAILURE); }