mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 691690 - Part 1: Add UTF-8 flag to createFixupURI. r=bz
This commit is contained in:
parent
34621450c8
commit
d6147c4165
@ -236,6 +236,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, PRUint32 aFixupF
|
||||
bool bAsciiURI = IsASCII(uriString);
|
||||
bool bUseNonDefaultCharsetForURI =
|
||||
!bAsciiURI &&
|
||||
!(aFixupFlags & FIXUP_FLAG_USE_UTF8) &&
|
||||
(scheme.IsEmpty() ||
|
||||
scheme.LowerCaseEqualsLiteral("http") ||
|
||||
scheme.LowerCaseEqualsLiteral("https") ||
|
||||
@ -322,7 +323,7 @@ nsDefaultURIFixup::CreateFixupURI(const nsACString& aStringURI, PRUint32 aFixupF
|
||||
uriString.Assign(NS_LITERAL_CSTRING("http://") + uriString);
|
||||
|
||||
// For ftp & http, we want to use system charset.
|
||||
if (!bAsciiURI)
|
||||
if (!bAsciiURI && !(aFixupFlags & FIXUP_FLAG_USE_UTF8))
|
||||
bUseNonDefaultCharsetForURI = true;
|
||||
} // end if checkprotocol
|
||||
|
||||
|
@ -63,6 +63,11 @@ interface nsIURIFixup : nsISupports
|
||||
*/
|
||||
const unsigned long FIXUP_FLAGS_MAKE_ALTERNATE_URI = 2;
|
||||
|
||||
/**
|
||||
* Use UTF-8 to encode the URI instead of platform charset.
|
||||
*/
|
||||
const unsigned long FIXUP_FLAG_USE_UTF8 = 4;
|
||||
|
||||
/**
|
||||
* Converts an internal URI (e.g. a wyciwyg URI) into one which we can
|
||||
* expose to the user, for example on the URL bar.
|
||||
|
Loading…
Reference in New Issue
Block a user