Combining Devanagari characters

前端 未结 6 1982
礼貌的吻别
礼貌的吻别 2020-12-05 02:40

I have something like

a = \"बिक्रम मेरो नाम हो\"

I want to achieve something like

a[0] = बि
a[1] = क्र
a[3] = म
         


        
6条回答
  •  攒了一身酷
    2020-12-05 03:24

    Indic and non Latin scripts like Hangul do not generally follow the idea of matching string indices to code points. It's generally a pain working with Indic scripts. Most characters are two bytes with some rare ones extending into three. With Dravidian, it's no defined order. See the Unicode specification for more details.

    That said,check here for some ideas about unicode and python with C++.

    Finally,as said by Dietrich, you might want to check out ICU too. It has bindings available for C/C++ and java via icu4c and icu4j respectively. There's some learning curve involved, so I suggest you set aside some loads of time for it. :)

提交回复
热议问题