[PATCH] Implemented llvm::sys::locale::columnWidth and isPrint for the case of generic UTF8-capable terminal.

Eli Friedman eli.friedman at gmail.com
Fri Aug 2 17:03:40 PDT 2013


On Fri, Aug 2, 2013 at 10:34 AM, Alexander Kornienko <alexfh at google.com> wrote:
>
>
> ================
> Comment at: lib/Support/LocaleGeneric.inc:40
> @@ +39,3 @@
> +//   * surrogates (category = Cs).
> +bool isPrint(int UCS) {
> +  // Sorted list of non-overlapping intervals of code points that are not
> ----------------
> Jordan Rose wrote:
>> Why 'int'? Why not uint32_t?
> This is not my invention as the function was declared with int argument from the beginning. I guess the reason is related to the fact that std::istream::get and other similar functions use int as a character type, which, IIUC, comes from the "has type int" part in [lex.ccon]:
> "An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter
> literal, or an ordinary character literal containing a single c-char not representable in the execution character set, is conditionally-supported, has type int, and has an implementation-deļ¬ned value."

FYI, multicharacter literals have absolutely nothing to do with Unicode.

-Eli




More information about the llvm-commits mailing list