2
**********************************************************************
3
* Copyright (C) 2005-2006, International Business Machines
4
* Corporation and others. All Rights Reserved.
5
**********************************************************************
8
#include "unicode/utypes.h"
10
#if !UCONFIG_NO_CONVERSION
11
#include "unicode/unistr.h"
12
#include "unicode/ucnv.h"
21
CharsetMatch::CharsetMatch()
22
: csr(0), confidence(0)
24
// nothing else to do.
27
void CharsetMatch::set(InputText *input, CharsetRecognizer *cr, int32_t conf)
34
const char* CharsetMatch::getName()const
36
return csr->getName();
39
const char* CharsetMatch::getLanguage()const
41
return csr->getLanguage();
44
int32_t CharsetMatch::getConfidence()const
49
int32_t CharsetMatch::getUChars(UChar *buf, int32_t cap, UErrorCode *status) const
51
UConverter *conv = ucnv_open(getName(), status);
52
int32_t result = ucnv_toUChars(conv, buf, cap, (const char *) textIn->fRawInput, textIn->fRawLength, status);