..:: AsmBB ::..: EncodingTable koi8-r.tbl
<img src="https://board.asm32.info/images/title.svg" alt="Title img">
<h1>AsmBB is ultrafast web forum, written entirely in assembly language. This site is the official support development forum and demo/test installation.</h1>
tag:board.asm32.info,2018-03-06:Thread3132020-03-22T13:48:17Zjohnfound on EncodingTable koi8-r.tbltag:board.asm32.info,2018-03-06:Post160812020-03-22T13:48:17Z
<blockquote><header>ganuonglachanh</header><p>Yes I asking about slug/tag generation, because I used to use this js function to handle slugify url in VietNamese:
</p>
<pre><code class=""> slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');
slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');
slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');
slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');
slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');
slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');
slug = slug.replace(/đ/gi, 'd');
</code></pre>
<p>My knowledge about UTF-8 encode is limited, still can't find a solution <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/sad.gif" alt=":-(" />
</p></blockquote>
<p>I will see what I can do about it. In my opinion, we need some general solution able to process such symbols in all languages the same way...</p>
johnfoundganuonglachanh on EncodingTable koi8-r.tbltag:board.asm32.info,2018-03-06:Post160802020-03-22T12:19:07Z
<blockquote><header>johnfound</header><blockquote><header>ganuonglachanh</header><p>Hi johnfound
</p>
<p>The default Utf8ToAnsi function use EncodingTable koi8-r.tbl, how can I make another EncodingTable to replace some other chars like ế => e (many more)
</p>
<p>Thank you!
</p></blockquote>
<p>Well, the only implemented code tables for now are WIN1251, CP866, KOI8R and KOI8U;
</p>
<p>But if you are asking about the slug/tag generation, you actually don't need this. I am using Utf8ToAnsi procedure here, because in the Russian KOI8 table the Cyrillic letters have the same codes as the UTF8 Latin letters with similar sound.
</p>
<p>After the conversion, the string remains valid UTF8 encoded, but all the Cyrillic letters are replaced with the respective Latin letters that can be read the proper way in Russian, Bulgarian, Serbian, etc.
</p>
<p>In other words, the use of Utf8ToAnsi is simply a hack. In order to fix the special Latin characters you will need different code at all.
</p>
</blockquote>
<p>Yes I asking about slug/tag generation, because I used to use this js function to handle slugify url in VietNamese:
</p>
<pre><code class=""> slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');
slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');
slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');
slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');
slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');
slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');
slug = slug.replace(/đ/gi, 'd');
</code></pre>
<p>My knowledge about UTF-8 encode is limited, still can't find a solution <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/sad.gif" alt=":-(" /> </p>
ganuonglachanh johnfound on EncodingTable koi8-r.tbltag:board.asm32.info,2018-03-06:Post160762020-03-22T11:27:06Z
<blockquote><header>ganuonglachanh</header><p>Hi johnfound
</p>
<p>The default Utf8ToAnsi function use EncodingTable koi8-r.tbl, how can I make another EncodingTable to replace some other chars like ế => e (many more)
</p>
<p>Thank you!
</p></blockquote>
<p>Well, the only implemented code tables for now are WIN1251, CP866, KOI8R and KOI8U;
</p>
<p>But if you are asking about the slug/tag generation, you actually don't need this. I am using Utf8ToAnsi procedure here, because in the Russian KOI8 table the Cyrillic letters have the same codes as the UTF8 Latin letters with similar sound.
</p>
<p>After the conversion, the string remains valid UTF8 encoded, but all the Cyrillic letters are replaced with the respective Latin letters that can be read the proper way in Russian, Bulgarian, Serbian, etc.
</p>
<p>In other words, the use of Utf8ToAnsi is simply a hack. In order to fix the special Latin characters you will need different code at all.
</p>
johnfoundganuonglachanh on EncodingTable koi8-r.tbltag:board.asm32.info,2018-03-06:Post160722020-03-22T11:14:05Z
<p>Hi johnfound
</p>
<p>The default Utf8ToAnsi function use EncodingTable koi8-r.tbl, how can I make another EncodingTable to replace some other chars like ế => e (many more)
</p>
<p>Thank you!</p>
ganuonglachanh