﻿<?xml version="1.0" encoding="utf-8"?>
<lgr xmlns="urn:ietf:params:xml:ns:lgr-1.0">
  <meta>
    <version comment="IDN Reference table for the Thai Language">1.1</version>
    <date>2025-04-08</date>
    <language>th</language>
    <unicode-version>6.3.0</unicode-version>
    <description type="text/html">
	<![CDATA[
	
	#IDN Table reference
	This Thai language table is based on the ICANN LGR for the Thai Language
	https://www.icann.org/sites/default/files/packages/lgr/lgr-second-level-thai-language-18may21-en.xml
	
	#Base Context Rule
	Base context rule disallows use of hyphen (U+002D) at the beginning, end or
	consecutively at the 3rd and 4th position in a label

	#Contact Info
	Contact Name: IDN Support
	Contact Email: registry-help@registry.godaddy
	Contact Phone: +1 (480) 651-9999
	]]>
	</description>
    <references>
      <reference id="0" comment="Any code point originally encoded in Unicode 1.1">The Unicode Standard 1.1</reference>
      <reference id="100">Thai Industrial Standard (TIS) 1566-2541(1988) http://www.ratchakitcha.soc.go.th/DATA/PDF/2542/E/088/9.PDF</reference>
      <reference id="101">Computers and the Thai Language https://lexitron.nectec.or.th/KM_HL5001/file_HL5001/Paper/Inter%20Journal/krrn_52085.pdf</reference>
      <reference id="102">Thai Generation Panel experts, private communication during review for second level </reference>
      <reference id="150">RFC 5891, Internationalized Domain Names in Applications (IDNA): Protocol http://tools.ietf.org/html/rfc5891</reference>
    </references>
  </meta>
  <data>
    <char cp="002D" not-when="hyphen-minus-disallowed" tag="Hyphen sc:Zyyy" ref="0" comment="HYPHEN-MINUS; &#x235F;" />
    <char cp="0030" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT ZERO; &#x235F;">
      <var cp="0E50" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0031" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT ONE; &#x235F;">
      <var cp="0E51" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0032" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT TWO; &#x235F;">
      <var cp="0E52" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0033" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT THREE; &#x235F;">
      <var cp="0E53" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0034" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT FOUR; &#x235F;">
      <var cp="0E54" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0035" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT FIVE; &#x235F;">
      <var cp="0E55" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0036" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT SIX; &#x235F;">
      <var cp="0E56" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0037" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT SEVEN; &#x235F;">
      <var cp="0E57" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0038" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT EIGHT; &#x235F;">
      <var cp="0E58" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0039" tag="Common-digit sc:Zyyy" ref="0" comment="DIGIT NINE; &#x235F;">
      <var cp="0E59" type="blocked" comment="Thai digit variant" />
    </char>
    <char cp="0E01" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E02" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E03" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E04" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E05" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E06" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E07" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E08" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E09" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0A" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0B" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0C" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0D" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0E" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E0F" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E10" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E11" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E12" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E13" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E14" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E15" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E16" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E17" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E18" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E19" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1A" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1B" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1C" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1D" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1E" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E1F" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E20" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E21" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E22" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E23" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E24" tag="fv3 sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E24 0E45" ref="0 100 101" comment="fv2, Thai" />
    <char cp="0E25" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E26" tag="fv3 sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E26 0E45" ref="0 100 101" comment="fv2, Thai" />
    <char cp="0E27" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E28" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E29" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2A" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2B" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2C" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2D" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2E" tag="cons sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2F" when="follows-any-precedes-end" tag="abbr sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E2F 0E25 0E2F" when="follows-any-precedes-end" ref="0 100 101" comment="Thai" />
    <char cp="0E30" when="follow-consonant-tone-sara-aa" tag="fv1 sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E31" when="between-consonant-and-ct" tag="av sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E32" when="follows-consonant-tone" tag="fv1 sara-aa sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E34" when="follows-consonant" tag="av sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E35" when="follows-consonant" tag="av sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E36" when="follows-consonant" tag="av sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E37" when="follows-consonant" tag="av sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E38" when="follows-consonant" tag="bv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E39" when="follows-consonant" tag="bv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E3A" when="follows-consonant" tag="bd sc:Thai" ref="0 100 101" comment="= phinthu; Thai" />
    <char cp="0E40" when="precedes-consonant" tag="lv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E41" when="precedes-consonant" tag="lv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E42" when="precedes-consonant" tag="lv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E43" when="precedes-consonant" tag="lv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E44" when="precedes-consonant" tag="lv sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E46" when="follows-any-precedes-rep-cons-lv-end" tag="rep sc:Thai" ref="0 100 101" comment="Thai" />
    <char cp="0E47" when="follows-consonant" tag="ad sc:Thai" ref="0 100 101" comment="= maitaikhu; Thai" />
    <char cp="0E48" when="follows-consonant-av-bv" tag="sc:Thai tone" ref="0 100 101" comment="Thai" />
    <char cp="0E49" when="follows-consonant-av-bv" tag="sc:Thai tone" ref="0 100 101" comment="Thai" />
    <char cp="0E4A" when="follows-consonant-av-bv" tag="sc:Thai tone" ref="0 100 101" comment="Thai" />
    <char cp="0E4B" when="follows-consonant-av-bv" tag="sc:Thai tone" ref="0 100 101" comment="Thai" />
    <char cp="0E4C" when="follows-consonant-av-bv" tag="ad sc:Thai" ref="0 100 101" comment="= thanthakhat; Thai" />
    <char cp="0E4D" when="follows-consonant-av-bv" tag="ad sc:Thai" ref="0 100 101" comment="= nikhahit; Thai" />
    <char cp="0E4D 0E32" when="follows-consonant-tone" ref="0 100 101" comment="= sara am sequence; Thai" />
    <char cp="0E50" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT ZERO">
      <var cp="0030" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E51" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT ONE">
      <var cp="0031" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E52" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT TWO">
      <var cp="0032" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E53" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT THREE">
      <var cp="0033" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E54" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT FOUR">
      <var cp="0034" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E55" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT FIVE">
      <var cp="0035" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E56" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT SIX">
      <var cp="0036" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E57" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT SEVEN">
      <var cp="0037" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E58" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT EIGHT">
      <var cp="0038" type="blocked" comment="ASCII digit variant" />
    </char>
    <char cp="0E59" tag="sc:Thai Thai-digit" ref="0" comment="THAI DIGIT NINE">
      <var cp="0039" type="blocked" comment="ASCII digit variant" />
    </char>
  </data>
  <!--Rules section goes here-->
  <rules>
    <!--Character class definitions go here-->
    <class name="above-vowel" from-tag="av" comment="Any Thai above vowel" />
    <class name="below-vowel" from-tag="bv" comment="Any Thai below vowel" />
    <class name="consonant" from-tag="cons" comment="Any Thai consonant" />
    <class name="leading-vowel" from-tag="lv" comment="Any Thai leading vowel" />
    <class name="repetition" from-tag="rep" comment="The Thai repetition mark, MAIYAMOK" />
    <class name="sara-aa" from-tag="sara-aa" comment="Thai SARA AA" />
    <class name="tone" from-tag="tone" comment="Any Thai tone mark" />
    <union name="c-av-bv" comment="Any Thai consonant, vowel-above or vowel-below">
      <class by-ref="consonant" />
      <class by-ref="above-vowel" />
      <class by-ref="below-vowel" />
    </union>
    <union name="ct" comment="Any Thai consonant or tone mark">
      <class by-ref="consonant" />
      <class by-ref="tone" />
    </union>
    <union name="ctaa" comment="Any Thai consonant, tone or sara-aa">
      <class by-ref="consonant" />
      <class by-ref="tone" />
      <class by-ref="sara-aa" />
    </union>
    <class name="common-digits" from-tag="Common-digit" comment="Digits from the ASCII range; &#x235F;" />
    <class name="thai-digits" from-tag="Thai-digit" comment="Thai digits" />
    <class name="hyphen" from-tag="Hyphen" comment="The Hyphen-minus character &#x235F;" />
    <!--Whole label evaluation and context rules go here-->
    <rule name="leading-combining-mark" ref="150" comment="RFC 5891 restrictions on placement of combining marks &#x235F;">
      <start />
      <union>
        <class property="gc:Mn" />
        <class property="gc:Mc" />
      </union>
    </rule>
    <rule name="hyphen-minus-disallowed" ref="150" comment="RFC 5891 restrictions on placement of U+002D &#x235F;">
      <choice>
        <rule comment="no leading hyphen">
          <look-behind>
            <start />
          </look-behind>
          <anchor />
        </rule>
        <rule comment="no trailing hyphen">
          <anchor />
          <look-ahead>
            <end />
          </look-ahead>
        </rule>
        <rule comment="no consecutive hyphens in third and fourth position in the label">
          <look-behind>
            <start />
            <any />
            <any />
            <class by-ref="hyphen" />
          </look-behind>
          <anchor />
        </rule>
      </choice>
    </rule>
    <rule name="precedes-consonant" comment="WLE 7.2: check if current cp is preceding a consonant">
      <anchor />
      <look-ahead>
        <class by-ref="consonant" />
      </look-ahead>
    </rule>
    <rule name="follows-consonant" comment="WLE 7.3: check if current cp is following a consonant">
      <look-behind>
        <class by-ref="consonant" />
      </look-behind>
      <anchor />
    </rule>
    <rule name="between-consonant-and-ct" comment="WLE 7.4: check if current cp is in between a consonant and either tone or consonant">
      <look-behind>
        <class by-ref="consonant" />
      </look-behind>
      <anchor />
      <look-ahead>
        <class by-ref="ct" />
      </look-ahead>
    </rule>
    <rule name="follow-consonant-tone-sara-aa" comment="WLE 7.5: U+0E30 (THAI CHARACTER SARA A, ะ) can follow a consonant, a tone or U+0E32 (THAI CHARACTER SARA AA, า)">
      <look-behind>
        <class by-ref="ctaa" />
      </look-behind>
      <anchor />
    </rule>
    <rule name="follows-consonant-tone" comment="WLE 7.6, 7.9: check if current cp is following a consonant or a tone">
      <look-behind>
        <class by-ref="ct" />
      </look-behind>
      <anchor />
    </rule>
    <rule name="follows-consonant-av-bv" comment="WLE 7.7, 7.8: A tone-mark, THANTHAKHAT, NIKAHIT can only follow a consonant, above-vowel or below-vowel">
      <look-behind>
        <class by-ref="c-av-bv" />
      </look-behind>
      <anchor />
    </rule>
    <rule name="follows-any-precedes-end" ref="102" comment="WLE SL1: An abbreviation mark, PAIYANNOI cannot be at the beginning of the label and must end it ">
      <look-behind>
        <any />
      </look-behind>
      <anchor />
      <look-ahead>
        <end />
      </look-ahead>
    </rule>
    <rule name="follows-any-precedes-rep-cons-lv-end" ref="102" comment="WLE SL2: A repetition mark, MAIYAMOK cannot be at the beginning of the label and must be followed by itself, a consonat or a leading vowel">
      <look-behind>
        <any />
      </look-behind>
      <anchor />
      <look-ahead>
        <choice>
          <class by-ref="consonant" />
          <class by-ref="repetition" />
          <class by-ref="leading-vowel" />
          <end />
        </choice>
      </look-ahead>
    </rule>
    <rule name="digit-mixing" comment="restrictions on mixing digits">
      <choice>
        <rule>
          <class by-ref="common-digits" />
          <any count="0+" />
          <class by-ref="thai-digits" />
        </rule>
        <rule>
          <class by-ref="thai-digits" />
          <any count="0+" />
          <class by-ref="common-digits" />
        </rule>
      </choice>
    </rule>
    <!--Action elements go here - order defines precedence-->
    <action disp="invalid" match="leading-combining-mark" ref="150" comment="labels with leading combining marks are invalid &#x235F;" />
    <action disp="invalid" match="digit-mixing" comment="a label violating the restriction on digit mixing is invalid" />
    <action disp="invalid" any-variant="out-of-repertoire-var" comment="any variant label with a code point out of repertoire is invalid &#x235F;" />
    <action disp="blocked" any-variant="blocked" comment="any variant label containing blocked variants is blocked &#x235F;" />
    <action disp="allocatable" all-variants="allocatable" comment="variant labels with all variants allocatable are allocatable &#x235F;" />
    <action disp="valid" comment="catch all (default action) &#x235F;" />
  </rules>
</lgr>