How to sort japanese, korean and chinese text?

Hi.

I just wondering how to sort japanese /korean / chinese text in game?

Do anyone have any tips or best practice?

Or maybe any lua library recommendations?

Thank you

A quick google search reveals that each language follows a different sorting system. There’s not a single system which will work for all three.

  • Korean - Hangul Syllable Order: Korean sorting relies on the order of Hangul syllables, which are structured into initial (consonant), middle (vowel), and sometimes final components - Hangul Stroke Order - The correct way to write in Korean
  • Japanese - Gojūon (五十音) System: This is the standard method, similar to alphabetical order, which arranges the Japanese phonetic symbols (kana) by their sound
  • Chinese - There seems to be multiple ways. One is Kangxi Radical and Stroke Count Sort: This traditional method sorts characters by their semantic component (radical) and then by the number of strokes in the character

The question is if you need to sort at runtime or if you can do the sorting when you build your project?

I want to sort it on runtime. I’m building a card game. The card ideally can be sorted by name, level and color. But i have trouble sorting the card in deck by name when using Korean / Japanese / Chinese.

Due the card deck is not a fixed set, the sorting cannot be done on build phase

Just an idea of how to achieve this without tricky locale-aware sorting.
I guess you know all the cards in the deck and what the order looks like in those languages.
What if you’d associate an index with each card based on that desired order and use that for sorting?

Chinese: you can use the first letter of Pinyin for sorting. like 你好, Pinyin is NiHao.

the idea is to the player can change the way the card is sorted, for easier navigation