From dca984e4fad8d93b12a302b810ab56ec6eaaf37d Mon Sep 17 00:00:00 2001 From: "jshin%mailaps.org" Date: Mon, 8 Nov 2004 05:20:05 +0000 Subject: [PATCH] bug 268219 NS_CopyNativeToUnicode/NS_CopyUnicodeToNative on Mac OS X should use CopyUTF8toUTF16/CopyUTF16toUTF8, r=ccarlen sr=darin git-svn-id: svn://10.0.0.236/trunk@165109 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsNativeCharsetUtils.cpp | 70 ++++++++++++----------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/mozilla/xpcom/io/nsNativeCharsetUtils.cpp b/mozilla/xpcom/io/nsNativeCharsetUtils.cpp index 55b5c63cbee..be859776a20 100644 --- a/mozilla/xpcom/io/nsNativeCharsetUtils.cpp +++ b/mozilla/xpcom/io/nsNativeCharsetUtils.cpp @@ -24,6 +24,7 @@ * Frank Tang * Brendan Eich * Sergei Dolgov + * Jungshik Shin * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -41,10 +42,44 @@ #include "xpcom-private.h" +//----------------------------------------------------------------------------- +// XP_MACOSX or XP_BEOS +//----------------------------------------------------------------------------- +#if defined(XP_BEOS) || defined(XP_MACOSX) + +#include "nsAString.h" +#include "nsReadableUtils.h" +#include "nsString.h" + +NS_COM nsresult +NS_CopyNativeToUnicode(const nsACString &input, nsAString &output) +{ + CopyUTF8toUTF16(input, output); + return NS_OK; +} + +NS_COM nsresult +NS_CopyUnicodeToNative(const nsAString &input, nsACString &output) +{ + CopyUTF16toUTF8(input, output); + return NS_OK; +} + +void +NS_StartupNativeCharsetUtils() +{ +} + +void +NS_ShutdownNativeCharsetUtils() +{ +} + + //----------------------------------------------------------------------------- // XP_UNIX //----------------------------------------------------------------------------- -#if defined(XP_UNIX) +#elif defined(XP_UNIX) #include // mbtowc, wctomb #include // setlocale @@ -824,39 +859,6 @@ NS_ShutdownNativeCharsetUtils() nsNativeCharsetConverter::GlobalShutdown(); } -//----------------------------------------------------------------------------- -// XP_BEOS -//----------------------------------------------------------------------------- -#elif defined(XP_BEOS) - -#include "nsAString.h" -#include "nsReadableUtils.h" -#include "nsString.h" - -NS_COM nsresult -NS_CopyNativeToUnicode(const nsACString &input, nsAString &output) -{ - CopyUTF8toUTF16(input, output); - return NS_OK; -} - -NS_COM nsresult -NS_CopyUnicodeToNative(const nsAString &input, nsACString &output) -{ - CopyUTF16toUTF8(input, output); - return NS_OK; -} - -void -NS_StartupNativeCharsetUtils() -{ -} - -void -NS_ShutdownNativeCharsetUtils() -{ -} - //----------------------------------------------------------------------------- // XP_WIN //-----------------------------------------------------------------------------