mirror of
https://github.com/openharmony/global_i18n_lite.git
synced 2026-07-01 01:37:55 -04:00
@@ -21,10 +21,6 @@
|
||||
|
||||
using namespace OHOS::I18N;
|
||||
|
||||
const std::set<std::string> LocaleInfo::SCRIPTS = {
|
||||
"Hans", "Latn", "Hant", "Qaag", "Cyrl", "Deva", "Guru"
|
||||
};
|
||||
|
||||
void LocaleInfo::Init(const char *newLang, const char *newScript, const char *newRegion, int &status)
|
||||
{
|
||||
id = nullptr;
|
||||
@@ -412,7 +408,19 @@ bool LocaleInfo::IsScript(const char *start, uint8_t length)
|
||||
if (length != SCRIPT_LENGTH || start == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (SCRIPTS.find(std::string(start, length)) != SCRIPTS.end()) {
|
||||
if (memcmp(start, "Hans", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Latn", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Hant", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Qaag", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Cyrl", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Deva", length) == 0) {
|
||||
return true;
|
||||
} else if (memcmp(start, "Guru", length) == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -65,7 +65,7 @@ void NumberData::SetNumSystem(std::string *numSym, const int numSize)
|
||||
return;
|
||||
}
|
||||
ArrayCopy(nativeNums, NUM_SIZE, numSym, numSize);
|
||||
if (!(numSym[0]).empty() && (numSym[0].at(0) != '0')) {
|
||||
if (!(numSym[0]).empty() && ((numSym[0]).at(0) != '0')) {
|
||||
isNative = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include "types.h"
|
||||
|
||||
namespace OHOS {
|
||||
@@ -213,7 +211,6 @@ private:
|
||||
void SetFail();
|
||||
void Init(const char *lang, const char *script, const char *region, int &status);
|
||||
const int CHAR_OFF = 48;
|
||||
static const std::set<std::string> SCRIPTS;
|
||||
static constexpr uint16_t OPT_LANG = 0x0001;
|
||||
static constexpr uint16_t OPT_SCRIPT = 0x0002;
|
||||
static constexpr uint16_t OPT_REGION = 0x0004;
|
||||
|
||||
Reference in New Issue
Block a user