X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..0f5d89e82340278ed3d7d50029f37cab2c41a57e:/icuSources/i18n/csmatch.cpp diff --git a/icuSources/i18n/csmatch.cpp b/icuSources/i18n/csmatch.cpp index f1d25d2d..83bf5316 100644 --- a/icuSources/i18n/csmatch.cpp +++ b/icuSources/i18n/csmatch.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** - * Copyright (C) 2005-2006, International Business Machines + * Copyright (C) 2005-2012, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -19,26 +21,36 @@ U_NAMESPACE_BEGIN CharsetMatch::CharsetMatch() - : csr(0), confidence(0) + : textIn(NULL), confidence(0), fCharsetName(NULL), fLang(NULL) { // nothing else to do. } -void CharsetMatch::set(InputText *input, CharsetRecognizer *cr, int32_t conf) +void CharsetMatch::set(InputText *input, const CharsetRecognizer *cr, int32_t conf, + const char *csName, const char *lang) { textIn = input; - csr = cr; confidence = conf; + fCharsetName = csName; + fLang = lang; + if (cr != NULL) { + if (fCharsetName == NULL) { + fCharsetName = cr->getName(); + } + if (fLang == NULL) { + fLang = cr->getLanguage(); + } + } } const char* CharsetMatch::getName()const { - return csr->getName(); + return fCharsetName; } const char* CharsetMatch::getLanguage()const { - return csr->getLanguage(); + return fLang; } int32_t CharsetMatch::getConfidence()const