FW: How to convert UChar(definded by icu same as the utf-8) to ascii?

2001-10-17 Thread Magda Danish (Unicode)
Title: Message   -Original Message-From: xuxiao.263 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 16, 2001 9:51 PMTo: [EMAIL PROTECTED]Subject: How to convert UChar(definded by icu same as the utf-8) to ascii? hi,I want your help. How to convert UChar(definded by icu same as the

Re: FW: How to convert UChar(definded by icu same as the utf-8) to ascii?

2001-10-17 Thread Markus Scherer
ICU defines UChar to be an unsigned 16-bit unit (an unsigned short, or uint16_t). Strings are in UTF-16, not UTF-8. When you know that you are dealing with Unicode code units and a conversion to US-ASCII, then all you need to do is to truncate each of these 16-bit units to 8 bits (to char). Th