1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "encodings/compact_lang_det/letterscript_enum.h"
7 #include "encodings/compact_lang_det/win/cld_logging.h"
9 static const char* kUnicodeLScriptNames
[ULScript_NUM_SCRIPTS
] = {
37 "Canadian_Aboriginal",
87 // Unicode 5.1 beta script names from
88 // http://www.unicode.org/Public/5.1.0/diffs/5.0.0-5.1.0.all.2.diffs
89 // NOTE: 'Vai ' => "Vaii" to make four letters, not three
90 // see http://unicode.org/iso15924/iso15924-codes.html
91 const char* const kLScriptName4
[ULScript_NUM_SCRIPTS
] = {
92 "Zyyy", "Latn", "Grek", "Cyrl", "Armn", "Hebr", "Arab", "Syrc",
93 "Thaa", "Deva", "Beng", "Guru", "Gujr", "Orya", "Taml", "Telu",
94 "Knda", "Mlym", "Sinh", "Thai", "Laoo", "Tibt", "Mymr", "Geor",
95 "Hani", "Ethi", "Cher", "Cans", "Ogam", "Runr", "Khmr", "Mong",
97 "Yiii", "Ital", "Goth", "Dsrt", "Zzzz", "Tglg", "Hano", "Buhd",
98 "Tagb", "Limb", "Tale", "Linb", "Ugar", "Shaw", "Osma", "Cprt",
99 "Bugi", "Copt", "Talu", "Glag", "Tfng", "Sylo", "Xpeo", "Khar",
100 "Bali", "Xsux", "Phnx", "Phag", "Nkoo",
103 "Sund", "Lepc", "Olck", "Vaii", "Saur", "Kali", "Rjng", "Lyci",
104 "Cari", "Lydi", "Cham",
108 const char* UnicodeLScriptName(const UnicodeLScript ls
) {
109 CHECK(ls
>= 0 && ls
< ULScript_NUM_SCRIPTS
);
110 return kUnicodeLScriptNames
[ls
];
114 const char* UnicodeLScriptCode(const UnicodeLScript ls
) {
115 CHECK(ls
>= 0 && ls
< ULScript_NUM_SCRIPTS
);
116 return kLScriptName4
[ls
];