<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="200977" data-post-id="200977">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sheharyarn" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sheharyarn/120/23945_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sheharyarn
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just tried <code>Unicode.Regex.compile("[[:Emoji:]]")</code> in my console and the regex correctly matched all the latest emojis. Thank you for your excellent work!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200977" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-200977" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200977"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="200982" data-post-id="200982">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Glad it does what you need it to do!  And appreciate the feedback, its great for motivation <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>Next <a href="http://blog.unicode.org/2020/04/unicode-140-delayed-for-6-months.html" rel="nofollow">version of Unicode, 14.0</a>, will be out in September and I will have my <a href="https://github.com/elixir-unicode" rel="nofollow">Unicode libraries</a> up-to-date at launch time.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200982" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-200982" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200982"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="208394" data-post-id="208394">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Introducing the very first version of <a href="https://hex.pm/packages/unicode_transform" rel="nofollow">Unicode Transform</a> which implements the <a href="https://unicode.org/reports/tr35/tr35-general.html#Transforms" rel="nofollow">CLDR Transform specification</a>.</p>
<p>In this first version it implements only the <code>Latin</code> to <code>ASCII</code> transform. This is commonly thought of as “remove accents” so although its only one very small step, its possible this transform has some use to the community.</p>
<h3><a name="p-208394-examples-1" class="anchor" href="#p-208394-examples-1" aria-label="Heading link" rel="nofollow"></a>Examples</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; Unicode.Transform.LatinAscii.transform "Considérant que la reconnaissance de la dignité inhérente à tous les membres"
"Considerant que la reconnaissance de la dignite inherente a tous les membres"

iex&gt; Unicode.Transform.LatinAscii.transform "Da die Anerkennung der angeborenen Würde und der gleichen und unveräußerlichen Rechte aller Mitglieder"
"Da die Anerkennung der angeborenen Wurde und der gleichen und unverausserlichen Rechte aller Mitglieder"
</code></pre>
<p>Text which is not in the latin script (technically not in the set <code>[[:Latin:][:Common:][:Inherited:][〇]]</code>) is passed through unchanged.</p>
<h4><a name="p-208394-background-2" class="anchor" href="#p-208394-background-2" aria-label="Heading link" rel="nofollow"></a>Background</h4>
<p>This is a fun project like most of the Unicode projects - if you can believe it! With a lot of rabbit holes. To implement this library required implementing</p>
<ul>
<li>
<p>Introspection of <a href="https://unicode.org/reports/tr44/#Properties" rel="nofollow">Unicode character properties</a> in <a href="https://hex.pm/packages/ex_unicode" rel="nofollow">ex_unicode</a>.</p>
</li>
<li>
<p><a href="https://unicode.org/reports/tr18/" rel="nofollow">Unicode Sets and Regular Expressions</a> in <a href="https://hex.pm/packages/unicode_set" rel="nofollow">unicode_set</a></p>
</li>
</ul>
<h3><a name="p-208394-implementation-3" class="anchor" href="#p-208394-implementation-3" aria-label="Heading link" rel="nofollow"></a>Implementation</h3>
<p>The implementation is in two parts:</p>
<ol>
<li>Generate an elixir module from the CLDR transform <code>.xml</code> file. For example, the <code>xml</code> for the <code>Latin</code> to <code>Ascii</code> transform goes from:</li>
</ol>
<pre data-code-wrap="elixir"><code class="lang-elixir"># This handles only Latin, Common, and IDEOGRAPHIC NUMBER ZERO (Han).
#
:: [[:Latin:][:Common:][:Inherited:][〇]] ;
#
:: NFD() ;
[[:Latin:][0-9]] { [:Mn:]+ → ; # maps to nothing; remove all Mn following Latin letter/digit
:: NFC() ;
#
# Some of the following mappings (noted) are from CLDR ‹character-fallback› data.
# (Note, here "‹character-fallback›" uses U+2039/U+203A to avoid XML issues)
#
# Latin letters and IPA
#
Æ → AE ; # 00C6;LATIN CAPITAL LETTER AE (from ‹character-fallback›)
Ð → D ; # 00D0;LATIN CAPITAL LETTER ETH
Ø → O ; # 00D8;LATIN CAPITAL LETTER O WITH STROKE
Þ → TH ; # 00DE;LATIN CAPITAL LETTER THORN
...
</code></pre>
<p>becomes:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Unicode.Transform.LatinAscii do
  use Unicode.Transform

  # This file is generated. Manual changes are not recommended
  # Source: Latin
  # Target: ASCII
  # Transform direction: both
  # Transform alias: und-t-d0-ascii und-Latn-t-s0-ascii

  # This handles only Latin, Common, and IDEOGRAPHIC NUMBER ZERO (Han).
  #
  filter("[[:Latin:][:Common:][:Inherited:][〇]]")
  #
  transform("NFD")
  # maps to nothing; remove all Mn following Latin letter/digit
  replace("[:Mn:]+", "", preceeded_by: "[[:Latin:][0-9]]")
  #
  transform("NFC")
  #
  # Some of the following mappings (noted) are from CLDR ‹character-fallback› data.
  # (Note, here "‹character-fallback›" uses U+2039/U+203A to avoid XML issues)
  #
  # Latin letters and IPA
  #
  # 00C6;LATIN CAPITAL LETTER AE (from ‹character-fallback›)
  replace("Æ", "AE")
  # 00D0;LATIN CAPITAL LETTER ETH
  replace("Ð", "D")
  # 00D8;LATIN CAPITAL LETTER O WITH STROKE
  replace("Ø", "O")
  ...
end
</code></pre>
<ol start="2">
<li>Step two is the implementation of the macros (<code>filter/1</code>, <code>convert/3</code>, <code>transform/1</code>) and others that generate the final code. This approach lets developers define their own transforms in an Elixir-friendly way.</li>
</ol>
<h3><a name="p-208394-next-steps-4" class="anchor" href="#p-208394-next-steps-4" aria-label="Heading link" rel="nofollow"></a>Next steps</h3>
<p>The current version implements a minimal part part of the standard. Although parsing and generating the module is largely conformant, the code generation is not yet complete. Therefore version <code>0.1.0</code> is only useful to people who can benefit from the <code>Unicode.Transform.LatinAscii.transform/1</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208394" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-208394" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208394"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="208412" data-post-id="208412">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi kip,</p>
<p>I don’t have much knowledge in this. Is the objective of CLDR Transform to allow one to parse text like those accented examples into basic ASCII while allowing one to revert it lossly back into its original “encoding”?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208412" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-208412" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208412"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="224023" data-post-id="224023">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://unicode.org/versions/Unicode14.0.0/" rel="nofollow">Unicode 14</a> is due for release in September.  As a preview, I have released <a href="https://hex.pm/packages/ex_unicode/1.12.0-rc.0" rel="nofollow">ex_unicode version 1.12.0-rc.0</a>. The key features of Unicode 14 are:</p>
<ul>
<li>
<p>Add 838 characters, for a total of 144,697 characters. These additions include <a href="https://unicode.org/versions/Unicode14.0.0/#New_Scripts" rel="nofollow">5 new scripts</a>, for a total of 159 scripts, as well as 37 new emoji characters.</p>
</li>
<li>
<p>Add support for lesser-used languages and unique written requirements worldwide, including numerous symbols additions. Funds from the <a href="https://www.unicode.org/consortium/adopt-a-character.html" rel="nofollow">Adopt-a-Character</a> program provided support for some of these additions. The new scripts and characters include:</p>
<ul>
<li>Toto, used to write the Toto language in India near Bhutan</li>
<li>Cypro-Minoan, an undeciphered historical script primarily used on the island of Cyprus</li>
<li>Vithkuqi, an historic script used to write Albanian, and undergoing a modern revival</li>
<li>Old Uyghur, an historic script used in Central Asia and elsewhere to write Turkic, Chinese, Mongolian, Tibetan, and Arabic languages</li>
<li>Tangsa, a modern script used to write the Tangsa language, which is spoken in India and Myanmar</li>
<li>Many Latin additions for extended IPA</li>
<li>Arabic script additions used to write languages across Africa and in Iran, Pakistan, Malaysia, Indonesia, Java, and Bosnia, and to write honorifics, and additions for Quranic use</li>
<li>Other character additions support languages of the Philippines, North America, India, and Mongolia</li>
</ul>
</li>
<li>
<p>Popular symbol additions:</p>
<ul>
<li>37 emoji characters. For complete statistics regarding all emoji as of Unicode 14.0, see <a href="https://www.unicode.org/emoji/charts-14.0/emoji-counts.html" rel="nofollow">Emoji Counts</a>. For more information about emoji additions in version 14.0, including new emoji ZWJ sequences and emoji modifier sequences, see <a href="https://unicode.org/emoji/charts-14.0/emoji-released.html" rel="nofollow">Emoji Recently Added, v14.0</a>.</li>
</ul>
</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="224023" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-224023" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="224023"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="224024" data-post-id="224024">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m very sorry for not replying to you earlier!</p>
<p>What you are describing - lossless bi-directional conversion - sounds like you’re referring to character set encoding.  Transforms ≠ Encoding.</p>
<p>Transforms are about changing representations and transliteration. For example, can we represent Chinese language in a romanised way?  This is not a replacement of one Chinese ideogram into a latin character. Its a phonetic transform (in this case, can be <a href="https://en.wikipedia.org/wiki/Pinyin" rel="nofollow">pinyin</a> or some <a href="https://en.wikipedia.org/wiki/Romanization_of_Chinese" rel="nofollow">other method</a>).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="224024" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-224024" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="224024"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="225771" data-post-id="225771">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Today is <a href="https://unicode.org/versions/Unicode14.0.0" rel="nofollow">Unicode 14</a> release day. All the related libraries I maintain are tested and updated against the new version. Several are released as <code>1.0</code> versions since the APIs are stable.</p>
<h3><a name="p-225771-ex_unicode-1120httpshexpmpackagesex_unicode1120-1" class="anchor" href="#p-225771-ex_unicode-1120httpshexpmpackagesex_unicode1120-1" aria-label="Heading link" rel="nofollow"></a><a href="https://hex.pm/packages/ex_unicode/1.12.0" rel="nofollow">ex_unicode 1.12.0</a></h3>
<p>Implements Unicode introspection. Helpful to identify the <a href="https://unicode.org/reports/tr24/" rel="nofollow">script</a>, <a href="http://unicode.org/L2/L2010/10449-tr49-2d1.html" rel="nofollow">character categories</a> and <a href="https://unicode.org/reports/tr23/" rel="nofollow">character properties</a>. For example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; Unicode.script ?خ
"arabic"
iex&gt; Unicode.category ?ä
:Ll
iex&gt; Unicode.category ?A
:Lu
iex&gt; Unicode.category ?🧐
:So
iex&gt; Unicode.properties ?A
[
  :alphabetic,
  :ascii_hex_digit,
  :cased,
  :changes_when_casefolded,
  :changes_when_casemapped,
  :changes_when_lowercased,
  :grapheme_base,
  :hex_digit,
  :id_continue,
  :id_start,
  :uppercase,
  :xid_continue,
  :xid_start
]
</code></pre>
<h3><a name="p-225771-unicode-set-10httpshexpmpackagesunicode_set100-2" class="anchor" href="#p-225771-unicode-set-10httpshexpmpackagesunicode_set100-2" aria-label="Heading link" rel="nofollow"></a><a href="https://hex.pm/packages/unicode_set/1.0.0" rel="nofollow">Unicode Set 1.0</a></h3>
<p>Implements <a href="https://unicode-org.github.io/icu/userguide/strings/unicodeset.html" rel="nofollow">Unicode Sets</a> that allow for flexible definition of unicode characters that can then be used as <a href="https://github.com/elixir-unicode/unicode_set#function-guards" rel="nofollow">guards</a>, to generate <a href="https://github.com/elixir-unicode/unicode_set#generating-compiled-patterns-for-string-matching" rel="nofollow">patterns</a>, <a href="https://github.com/elixir-unicode/unicode_set#generating-nimbleparsec-ranges" rel="nofollow">ranges</a> for <a href="https://hex.pm/packages/nimble_parsec" rel="nofollow">nimble_parsec</a> and <a href="https://github.com/elixir-unicode/unicode_set#compiling-extended-regular-expressions" rel="nofollow">regular expressions</a>.  Some examples:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># The character "๓" is the thai digit `1`
iex&gt; Unicode.Set.match? ?๓, "[[:digit:]]"
true

# Set operations allow union, insersection and difference
# This example matches on digits, but not the Thai script
iex&gt; Unicode.Set.match? ?๓, "[[:digit:]-[:thai:]]"
false

iex&gt; Unicode.Set.to_pattern("[{👦🏻}-{👦🏿}]")
{:ok, ["👦🏻", "👦🏼", "👦🏽", "👦🏾", "👦🏿"]}

iex&gt; Unicode.Regex.compile("\\p{Zs}")
{:ok, ~r/[\x{20}\x{A0}\x{1680}\x{2000}-\x{200A}\x{202F}\x{205F}\x{3000}]/u}

iex&gt; Unicode.Regex.compile("[:graphic:]")
{:ok,
 ~r/[\x{20}-\x{7E}\x{A0}-\x{AC}\x{AE}-\x{377}\x{37A}-\x{37F}...]/u}
</code></pre>
<h3><a name="p-225771-unicode-guards-10httpshexpmpackagesunicode_guards100-3" class="anchor" href="#p-225771-unicode-guards-10httpshexpmpackagesunicode_guards100-3" aria-label="Heading link" rel="nofollow"></a><a href="https://hex.pm/packages/unicode_guards/1.0.0" rel="nofollow">Unicode Guards 1.0</a></h3>
<p>Leverages <a href="https://hex.pm/packages/unicode_set" rel="nofollow">unicode_set</a> to define a set of guards for common use.  Examples:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Guards do
  import Unicode.Guards

  def upper(&lt;&lt; x :: utf8, _rest :: binary &gt;&gt;) when is_upper(x), do: :upper
  def lower(&lt;&lt; x :: utf8, _rest :: binary &gt;&gt;) when is_lower(x), do: :lower
  def digit(&lt;&lt; x :: utf8, _rest :: binary &gt;&gt;) when is_digit(x), do: :digit
  def whitespace(&lt;&lt; x :: utf8, _rest :: binary &gt;&gt;) when is_whitespace(x), do: :whitespace
  def currency(&lt;&lt; x :: utf8, _rest :: binary &gt;&gt;) when is_currency_symbol(x), do: :currency
end
</code></pre>
<h3><a name="p-225771-unicode-string-10httpshexpmpackagesunicode_string100-4" class="anchor" href="#p-225771-unicode-string-10httpshexpmpackagesunicode_string100-4" aria-label="Heading link" rel="nofollow"></a><a href="https://hex.pm/packages/unicode_string/1.0.0" rel="nofollow">Unicode String 1.0</a></h3>
<p>Implements:</p>
<ul>
<li>The <a href="https://www.unicode.org/versions/Unicode14.0.0/ch03.pdf" rel="nofollow">Unicode Case Folding</a> algorithm to provide case-independent equality checking irrespective of language or script.</li>
<li>The <a href="https://unicode.org/reports/tr29/" rel="nofollow">Unicode Segmentation</a> algorithm to detect, break or split strings into grapheme clusters, works and sentences.</li>
</ul>
<p>Examples:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; Unicode.String.equals_ignoring_case? "ABC", "abc"
true

iex&gt; Unicode.String.equals_ignoring_case? "beißen", "beissen"
true

iex&gt; Unicode.String.split "This is a sentence. And another.", break: :word
["This", " ", "is", " ", "a", " ", "sentence", ".", " ", "And", " ", "another", "."]

iex&gt; Unicode.String.split "This is a sentence. And another.", break: :word, trim: true
["This", "is", "a", "sentence", ".", "And", "another", "."]

iex&gt; Unicode.String.split "This is a sentence. And another.", break: :sentence
["This is a sentence. ", "And another."]
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="225771" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-225771" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="225771"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="225900" data-post-id="225900">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Way back in 2016, <a class="mention" href="/u/qqwy" rel="nofollow">@Qqwy</a> launched the <a href="https://hex.pm/packages/unicode" rel="nofollow">Unicode</a> package on hex. It was the original inspiration for <code>ex_unicode</code> - which is a project that I started in 2019 because I needed to support <a href="http://unicode.org/reports/tr35/#Unicode_Sets" rel="nofollow">Unicode Sets</a> and Level 1 of <a href="https://unicode.org/reports/tr18/" rel="nofollow">Unicode Regular Expressions</a> in order to work on <a href="https://unicode.org/reports/tr35/tr35-general.html#Transforms" rel="nofollow">CLDR Transforms</a>.  Everything in Unicode and CLDR ends up being a loooooong journey down many unexpected but very rewarding paths.</p>
<p>As <a class="mention" href="/u/wojtekmach" rel="nofollow">@wojtekmach</a> once said to me “CLDR is … vast”. Only later on did I truly understand just how vast. I still haven’t finished <a href="https://github.com/elixir-unicode/unicode_transform" rel="nofollow">CLDR transforms</a>.</p>
<p>Anyway, <a class="mention" href="/u/qqwy" rel="nofollow">@Qqwy</a> and I are combining efforts with the following changes:</p>
<ul>
<li><code>ex_unicode</code> will, from the next release, be published as <code>unicode</code>, replacing the currently published package. Since Qqwy’s original work was the inspiration for mine the APIs are consistent and upgrades will be easy.</li>
<li>Qqwy becomes a co-owner of the <a href="https://github.com/elixir-unicode" rel="nofollow">elixir-unicode</a> GitGub organisation.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="225900" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-225900" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="225900"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="261709" data-post-id="261709">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This week <a href="https://unicode.org/versions/Unicode15.0.0/" rel="nofollow">Unicode 15</a> was <a href="http://blog.unicode.org/2022/09/announcing-unicode-standard-version-150.html" rel="nofollow">announced</a>.</p>
<p>Today I’ve published <a href="https://hex.pm/packages/unicode/1.15.0" rel="nofollow">unicode 1.15.0</a> that is based upon Unicode 15.  There are no required changes to <a href="https://hex.pm/packages/unicode_set" rel="nofollow">unicode_set</a>, <a href="https://hex.pm/packages/unicode_string" rel="nofollow">unicode_string</a>, <a href="https://hex.pm/packages/unicode_guards" rel="nofollow">unicode_guards</a> or <a href="https://hex.pm/packages/unicode_transform" rel="nofollow">unicode_transform</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261709" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-261709" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261709"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="286983" data-post-id="286983">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Up next is <a href="https://github.com/elixir-unicode/unicode_unihan" rel="nofollow">unicode_unihan</a> which is a new library that introspects the <a href="https://www.unicode.org/reports/tr38/" rel="nofollow">Unihan database</a>.</p>
<p>If you thought that <a href="https://en.wikipedia.org/wiki/ISO/IEC_8859-1" rel="nofollow">Latin-1</a> with a 159 code points is tricky enough with <a href="https://en.wikipedia.org/wiki/Letter_case" rel="nofollow">majuscule</a> and minuscule and <a href="https://en.wikipedia.org/wiki/Diacritic" rel="nofollow">diacritics</a> - wait til you see Unihan.</p>
<p>Unihan is 98,000 code points (and counting) it’s built upon shared history, culture and politics amongst China, Japan, Korea and Vietnam. <a href="https://en.wikipedia.org/wiki/Han_Chinese" rel="nofollow">Han</a> refers to the Chinese people; <a href="https://en.wikipedia.org/wiki/Han_unification" rel="nofollow">Unihan</a> refers to the monumental task undertaken to try to produce a single set of code points that respects these historical, cultural and political contexts.</p>
<p>The resulting <a href="https://unicode.org/charts/unihan.html" rel="nofollow">Unihan Database</a> encapsulates a wealth of information. Which can now be introspected with a new <a href="https://github.com/elixir-unicode/unicode_unihan" rel="nofollow">unicode_unihan</a> library.</p>
<p>Motivated and inspired by <a class="mention" href="/u/jkwchui" rel="nofollow">@jkwchui</a> and the work he is doing at <a href="https://visual-fonts.com" rel="nofollow">https://visual-fonts.com</a> this library is a collaborative work in progress. Its early days but for anyone interested you’re very welcome to provide suggestions and feedback. Here’s a simple example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; Unicode.Unihan.unihan("人")
%{
  kUnihanCore2020: "GHJKMPT",
  kCNS1992: "1-4429",
  kFourCornerCode: ["8000.0"],
  kIRGHanyuDaZidian: ["10101.100"],
  kFrequency: "1",
  kGradeLevel: "1",
  codepoint: 20154,
  kCowles: ["5115.5", "5117"],
  kCNS1986: "1-4429",
  kHanyuPinlu: ["rén(16866)", "ren(280)"],
  kBigFive: "A448",
  kHanyuPinyin: ["10101.100:rén"],
  kTotalStrokes: %{"zh-Hans": 2, "zh-Hant": 2},
  kIICore: ["AGTJHKMP"],
  kSBGY: ["102.23"],
  kCihaiT: ["80.201"],
  kKPS0: ["FCC5"],
  kTGHZ2013: ["313.110:rén"],
  kIRGDaiKanwaZiten: ["00344"],
  kTaiwanTelegraph: ["0086"],
  kMorohashi: ["00344"],
  kDaeJaweon: "0190.010",
  kTGH: ["2013:10"],
  kKSC0: ["7649"],
  kMainlandTelegraph: ["0086"],
  kTang: ["*njin", "njin"],
  kHangul: [%{grapheme: "인", source: "0E"}],
  kIRG_TSource: "T1-4429",
  kJapaneseKun: ["HITO"],
  kIRGKangXi: ["0091.010"],
  kIRG_JSource: "J0-3F4D",
  kHanYu: ["10101.100"],
  kXerox: ["241:051"],
  kRSAdobe_Japan1_6: ["C+2579+9.2.0"],
  kIRG_KSource: "K0-6C51",
  kCangjie: "O",
  kFenn: ["429A"],
  kCantonese: ["jan4"],
  kVietnamese: ["nhân"],
  kLau: ["3328"],
  kGB1: "4043",
  kIRG_KPSource: "KP0-FCC5",
  kKoreanEducationHanja: ["2007"],
  kKorean: ["IN"],
  kJapaneseOn: ["JIN", "NIN"],
  kRSUnicode: ["9.0"],
  kGB0: "4043",
  kFennIndex: ["226.01"],
  kXHC1983: ["0959.010:rén"],
  kMatthews: [...],
  ...
}
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286983" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-286983" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286983"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/27063/load_more?page=3">Load more posts (11 remaining)</a>
</div></template></turbo-stream>