diff --git a/intl/uconv/idl/nsICharsetConverterManager2.idl b/intl/uconv/idl/nsICharsetConverterManager2.idl index 624ad37e861..e85d2d23efd 100644 --- a/intl/uconv/idl/nsICharsetConverterManager2.idl +++ b/intl/uconv/idl/nsICharsetConverterManager2.idl @@ -92,6 +92,11 @@ interface nsICharsetConverterManager2 : nsISupports */ nsIAtom GetCharsetAtom([const] in wstring charset); + /** + * Friendlier version. + */ + nsIAtom GetCharsetAtom2([const] in string charset); + /** * Get the human-readable name for the given charset. */ diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index 8fdace744a7..63150e8fe64 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -161,6 +161,7 @@ public: NS_IMETHOD GetCharsetDetectorList(nsISupportsArray ** aResult); NS_IMETHOD GetCharsetAtom(const PRUnichar * aCharset, nsIAtom ** aResult); + NS_IMETHOD GetCharsetAtom2(const char * aCharset, nsIAtom ** aResult); NS_IMETHOD GetCharsetTitle(const nsIAtom * aCharset, PRUnichar ** aResult); NS_IMETHOD GetCharsetTitle2(const nsIAtom * aCharset, nsString * aResult); NS_IMETHOD GetCharsetData(const nsIAtom * aCharset, const PRUnichar * aProp, @@ -1037,6 +1038,15 @@ NS_IMETHODIMP nsCharsetConverterManager::GetCharsetAtom( return NS_OK; } +NS_IMETHODIMP nsCharsetConverterManager::GetCharsetAtom2( + const char * aCharset, + nsIAtom ** aResult) +{ + nsAutoString str; + str.AssignWithConversion(aCharset); + return GetCharsetAtom(str.GetUnicode(), aResult); +} + NS_IMETHODIMP nsCharsetConverterManager::GetCharsetTitle( const nsIAtom * aCharset, PRUnichar ** aResult)