mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
70553064dd
--HG-- rename : intl/uconv/src/8859-1.uf => intl/uconv/8859-1.uf rename : intl/uconv/src/8859-1.ut => intl/uconv/8859-1.ut rename : intl/uconv/src/cp1252.uf => intl/uconv/cp1252.uf rename : intl/uconv/src/cp1252.ut => intl/uconv/cp1252.ut rename : intl/uconv/src/macroman.uf => intl/uconv/macroman.uf rename : intl/uconv/src/macroman.ut => intl/uconv/macroman.ut rename : intl/uconv/src/nsCP1252ToUnicode.cpp => intl/uconv/nsCP1252ToUnicode.cpp rename : intl/uconv/src/nsCP1252ToUnicode.h => intl/uconv/nsCP1252ToUnicode.h rename : intl/uconv/src/nsConverterInputStream.cpp => intl/uconv/nsConverterInputStream.cpp rename : intl/uconv/src/nsConverterInputStream.h => intl/uconv/nsConverterInputStream.h rename : intl/uconv/src/nsConverterOutputStream.cpp => intl/uconv/nsConverterOutputStream.cpp rename : intl/uconv/src/nsConverterOutputStream.h => intl/uconv/nsConverterOutputStream.h rename : intl/uconv/src/nsISO88591ToUnicode.cpp => intl/uconv/nsISO88591ToUnicode.cpp rename : intl/uconv/src/nsISO88591ToUnicode.h => intl/uconv/nsISO88591ToUnicode.h rename : intl/uconv/src/nsMacRomanToUnicode.cpp => intl/uconv/nsMacRomanToUnicode.cpp rename : intl/uconv/src/nsMacRomanToUnicode.h => intl/uconv/nsMacRomanToUnicode.h rename : intl/uconv/src/nsReplacementToUnicode.cpp => intl/uconv/nsReplacementToUnicode.cpp rename : intl/uconv/src/nsReplacementToUnicode.h => intl/uconv/nsReplacementToUnicode.h rename : intl/uconv/src/nsScriptableUConv.cpp => intl/uconv/nsScriptableUConv.cpp rename : intl/uconv/src/nsScriptableUConv.h => intl/uconv/nsScriptableUConv.h rename : intl/uconv/src/nsTextToSubURI.cpp => intl/uconv/nsTextToSubURI.cpp rename : intl/uconv/src/nsTextToSubURI.h => intl/uconv/nsTextToSubURI.h rename : intl/uconv/src/nsUConvModule.cpp => intl/uconv/nsUConvModule.cpp rename : intl/uconv/src/nsUTF8ConverterService.cpp => intl/uconv/nsUTF8ConverterService.cpp rename : intl/uconv/src/nsUTF8ConverterService.h => intl/uconv/nsUTF8ConverterService.h rename : intl/uconv/src/nsUTF8ToUnicode.cpp => intl/uconv/nsUTF8ToUnicode.cpp rename : intl/uconv/src/nsUTF8ToUnicode.h => intl/uconv/nsUTF8ToUnicode.h rename : intl/uconv/src/nsUTF8ToUnicodeSSE2.cpp => intl/uconv/nsUTF8ToUnicodeSSE2.cpp rename : intl/uconv/src/nsUnicodeToCP1252.cpp => intl/uconv/nsUnicodeToCP1252.cpp rename : intl/uconv/src/nsUnicodeToCP1252.h => intl/uconv/nsUnicodeToCP1252.h rename : intl/uconv/src/nsUnicodeToISO88591.cpp => intl/uconv/nsUnicodeToISO88591.cpp rename : intl/uconv/src/nsUnicodeToISO88591.h => intl/uconv/nsUnicodeToISO88591.h rename : intl/uconv/src/nsUnicodeToMacRoman.cpp => intl/uconv/nsUnicodeToMacRoman.cpp rename : intl/uconv/src/nsUnicodeToMacRoman.h => intl/uconv/nsUnicodeToMacRoman.h rename : intl/uconv/src/nsUnicodeToUTF8.cpp => intl/uconv/nsUnicodeToUTF8.cpp rename : intl/uconv/src/nsUnicodeToUTF8.h => intl/uconv/nsUnicodeToUTF8.h
70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef nsUTF8ToUnicode_h___
|
|
#define nsUTF8ToUnicode_h___
|
|
|
|
#include "nsUCSupport.h"
|
|
|
|
// Class ID for our UTF8ToUnicode charset converter
|
|
// {5534DDC0-DD96-11d2-8AAC-00600811A836}
|
|
#define NS_UTF8TOUNICODE_CID \
|
|
{ 0x5534ddc0, 0xdd96, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
|
|
|
|
#define NS_UTF8TOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=UTF-8"
|
|
|
|
//#define NS_ERROR_UCONV_NOUTF8TOUNICODE
|
|
// NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_UCONV, 0x31)
|
|
|
|
//----------------------------------------------------------------------
|
|
// Class nsUTF8ToUnicode [declaration]
|
|
|
|
|
|
/**
|
|
* A character set converter from UTF8 to Unicode.
|
|
*
|
|
* @created 18/Mar/1998
|
|
* @modified 04/Feb/2000
|
|
* @author Catalin Rotaru [CATA]
|
|
*/
|
|
|
|
class nsUTF8ToUnicode : public nsBasicDecoderSupport
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* Class constructor.
|
|
*/
|
|
nsUTF8ToUnicode();
|
|
|
|
protected:
|
|
|
|
uint32_t mUcs4; // cached Unicode character
|
|
uint8_t mState; // cached expected number of bytes per UTF8 character sequence
|
|
uint8_t mBytes;
|
|
bool mFirst;
|
|
|
|
//--------------------------------------------------------------------
|
|
// Subclassing of nsDecoderSupport class [declaration]
|
|
|
|
NS_IMETHOD GetMaxLength(const char * aSrc, int32_t aSrcLength,
|
|
int32_t * aDestLength);
|
|
|
|
//--------------------------------------------------------------------
|
|
// Subclassing of nsBasicDecoderSupport class [declaration]
|
|
|
|
NS_IMETHOD Convert(const char * aSrc, int32_t * aSrcLength,
|
|
char16_t * aDest, int32_t * aDestLength);
|
|
|
|
//--------------------------------------------------------------------
|
|
// Subclassing of nsBasicDecoderSupport class [declaration]
|
|
|
|
NS_IMETHOD Reset();
|
|
|
|
};
|
|
|
|
#endif /* nsUTF8ToUnicode_h___ */
|
|
|