From a9c12692ed11a4712ceb743f446e51a735eeabb6 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 30 Jul 2014 12:01:53 +0900 Subject: [PATCH] [SD10] Add script checks for Lao and Khmer Bug: 15840116 Change-Id: Id72b739e73cb3e72f56e1872ad9d60469555e193 --- java/res/values/attrs.xml | 2 ++ java/res/xml/keyboard_layout_set_khmer.xml | 2 ++ java/res/xml/keyboard_layout_set_lao.xml | 2 ++ .../android/inputmethod/latin/utils/ScriptUtils.java | 10 ++++++++++ 4 files changed, 16 insertions(+) diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 5434106c5..9d828ef91 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -488,6 +488,8 @@ + + diff --git a/java/res/xml/keyboard_layout_set_khmer.xml b/java/res/xml/keyboard_layout_set_khmer.xml index 181f98b3d..752c8520a 100644 --- a/java/res/xml/keyboard_layout_set_khmer.xml +++ b/java/res/xml/keyboard_layout_set_khmer.xml @@ -20,6 +20,8 @@ + + mSpellCheckerLanguageToScript; static { // List of the supported languages and their associated script. We won't check @@ -122,6 +124,14 @@ public class ScriptUtils { // or Georgian supplement block, U+2D00..U+2D2F return (codePoint >= 0x10A0 && codePoint <= 0x10FF || codePoint >= 0x2D00 && codePoint <= 0x2D2F); + case SCRIPT_KHMER: + // Khmer letters are in unicode block U+1780..U+17FF, and the Khmer symbols block + // is U+19E0..U+19FF + return (codePoint >= 0x1780 && codePoint <= 0x17FF + || codePoint >= 0x19E0 && codePoint <= 0x19FF); + case SCRIPT_LAO: + // The Lao block is U+0E80..U+0EFF + return (codePoint >= 0xE80 && codePoint <= 0xEFF); case SCRIPT_UNKNOWN: return true; default: