From 15dea921faa583ef58677263b58d64aaa92c7d4d Mon Sep 17 00:00:00 2001 From: "cata%netscape.com" Date: Sat, 22 Apr 2000 17:49:55 +0000 Subject: [PATCH] New interface method. --- intl/uconv/idl/nsICharsetConverterManager2.idl | 5 +++++ intl/uconv/src/nsCharsetConverterManager.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/intl/uconv/idl/nsICharsetConverterManager2.idl b/intl/uconv/idl/nsICharsetConverterManager2.idl index 624ad37e8619..e85d2d23efdb 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 8fdace744a7c..63150e8fe64d 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)