UTF-8 to ASCII using ICU Library?

I don't know about ICU but ICONV does this and its quite easy to learn. It's only about 3-4 calls and what you need in your case is to use the ICONV_SET_TRANSLITERATE flag using iconvctl().

The iconvctl function doesn't seem to be part of standard iconv implementations. At least the Linux system I am working on doesn't have it. – GetFree Oct 7 '08 at 4:38 iconv is not a standard.It is a library.

If you don't have iconvctl, yours is broken: gnu. Org/software/libiconv – shoosh Oct 7 '08 at 17:36 Look at the end of this page: gnu.Org/software/libiconv/documentation/libiconv/… (section "CONFORMING TO") – GetFree Oct 7 '08 at 19:26 @shoosh iconv is part of the unix standard, but not iconvctl. – bames53 Nov 2 at 18:49.

Try this, ucnv_convert("US-ASCII", "UTF-8", targer, targetsize, source, sourcesize, pError).

The ß->ss decomposition tells me you want the compatibility decomposition. In ICU, you need class Normalizer for that. Afterwards, you will end up with something like L'odz'.

From this string, you can simply remove the non-ASCII characters. No need for ICU, plain STL will do.

I wrote a callback that decomposes and then does some substitution. It could probably be implemented as a transliteration. Code is here decompcb.

C and header is nearby. Install it as follows on a Unicode-to-ASCII converter: ucnv_setFromUCallBack(gConverter, &UCNV_FROM_U_CALLBACK_DECOMPOSE, &status); then use gConverter to convert from unicode to ASCII.

The Latin-ASCII transliterator went into ICU 4.6 / CLDR 1.9. – Steven R. Loomis Jul 29 at 0:09.

This isn't an area I'm an expert in, but if you don't have a library handy that does it for you easily then you might be better of just creating a lookup table/map which contains the UTF-8 -> ASCII values. Ie. The key is the UTF-8 char, the value is the ASCII sequence of chars.

Unfortunately, transliteration is a little more complicated than that. – GetFree Oct 7 '08 at 4:34.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions