1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 #include "nsICharsetConverterManager.h"
13 enum ConverterRequest
{
20 static nsISupports
* GetUconvObject(int CodePage
, ConverterRequest aReq
);
21 static void FreeUconvObjects();
23 static nsICharsetConverterManager
* gCharsetManager
;
26 #define CHAR_BUFFER_SIZE 1024
27 typedef nsAutoTArray
<char, CHAR_BUFFER_SIZE
> nsAutoCharBuffer
;
28 typedef nsAutoTArray
<PRUnichar
, CHAR_BUFFER_SIZE
> nsAutoChar16Buffer
;
30 nsresult
WideCharToMultiByte(int aCodePage
, const PRUnichar
* aSrc
,
31 int32_t aSrcLength
, nsAutoCharBuffer
& aResult
,
32 int32_t& aResultLength
);
33 nsresult
MultiByteToWideChar(int aCodePage
, const char* aSrc
,
34 int32_t aSrcLength
, nsAutoChar16Buffer
& aResult
,
35 int32_t& aResultLength
);