/*
 * Copyright (c) 2017 Waritnan Sookbuntherng
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.lion328.thaifixes;

public class ThaiUtil
{

    public static final char THAI_CHAR_RANGE_MIN = 3585;
    public static final char THAI_CHAR_RANGE_MAX = 3675;
    public static final String LOWER_CHARS = "ฺุู";
    public static final String SPECIAL_UPPER_CHARS = "่้๊๋";
    public static final String UPPER_CHARS = "ัิีึื็์ํ๎" + SPECIAL_UPPER_CHARS;
    public static final String LONG_TAIL_CHARS = "ปฟฝฬ";
    public static final char SARA_UM = 'ำ';

    public static boolean isThaiChar(char c)
    {
        return c >= THAI_CHAR_RANGE_MIN && c <= THAI_CHAR_RANGE_MAX;
    }

    public static boolean isSpecialThaiChar(char c)
    {
        return isUpperThaiChar(c) || isLowerThaiChar(c);
    }

    public static boolean isUpperThaiChar(char c)
    {
        return UPPER_CHARS.indexOf(c) != -1;
    }

    public static boolean isLowerThaiChar(char c)
    {
        return LOWER_CHARS.indexOf(c) != -1;
    }

    public static boolean isSpecialUpperThaiChar(char c)
    {
        return SPECIAL_UPPER_CHARS.indexOf(c) != -1;
    }

    public static boolean isVeryLongTailThaiChar(char c)
    {
        return LONG_TAIL_CHARS.indexOf(c) != -1;
    }
}

@@ -1233,12 +1233,16 @@
 N = 
-3585
+'%5Cu0E01'
 ;%0A  
@@ -1294,12 +1294,16 @@
 X = 
-3675
+'%5Cu0E5B'
 ;%0A  
@@ -1350,11 +1350,26 @@
  = %22
-%E0%B8%B8%E0%B8%B9%E0%B8%BA
+%5Cu0E38%5Cu0E39%5Cu0E3A
 %22;%0A 
@@ -1425,12 +1425,32 @@
  = %22
-%E0%B9%88%E0%B9%89%E0%B9%8A%E0%B9%8B
+%5Cu0E48%5Cu0E49%5Cu0E4A%5Cu0E4B
 %22;%0A 
@@ -1498,17 +1498,62 @@
  = %22
-%E0%B8%B1%E0%B8%B4%E0%B8%B5%E0%B8%B6%E0%B8%B7%E0%B9%87%E0%B9%8C%E0%B9%8D%E0%B9%8E
+%5Cu0E31%5Cu0E34%5Cu0E35%5Cu0E36%5Cu0E37%5Cu0E47%5Cu0E4C%5Cu0E4D%5Cu0E4E
 %22 + 
@@ -1627,12 +1627,32 @@
  = %22
-%E0%B8%9B%E0%B8%9F%E0%B8%9D%E0%B8%AC
+%5Cu0E1B%5Cu0E1F%5Cu0E1D%5Cu0E2C
 %22;%0A 
@@ -1694,9 +1694,14 @@
  = '
-%E0%B8%B3
+%5Cu0E33
 ';%0A%0A

Change thai characters in ThaiUtil.java to unicode literal