Change all accented letters to normal letters in C++

后端 未结 7 1088
迷失自我
迷失自我 2021-02-13 10:18

The question

How can you change all accented letters to normal letters in C++ (or in C)?

By that, I mean something like eéèêaàäâçc would become

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 11:03

    I am afraid there is no easy way around here.

    In application I work on this was solved by using internal codepage tables, each codepage table (like 1250, 1251, 1252, etc) contained actual codepage letter and non-diacritic equivalent. Tables were auto generated using c#, it contains some classes that really make that easy (with some heuristics actually), also java allows to implement it quicly.

    This was actually for multibyte data with codepages, but it could be used for UNICODE strings (by just searching all tables for given unicode letter).

提交回复
热议问题