Does Xcode's Debug Console Handle/Print Malformed UTF-8 Correctly?
Does Xcode's Debug Console Handle/Print Malformed UTF-8 Correctly?
- Subject: Does Xcode's Debug Console Handle/Print Malformed UTF-8 Correctly?
- From: Andreas Grosam <email@hidden>
- Date: Wed, 24 Aug 2011 17:54:30 +0200
Well, the topic says it.
For instance, a 0xC0 does not exist in a wellformed UTF-8 sequence. When printing such a malformed sequence to Xcode's debug console (via printf or std::cout) Xcode's console apparently becomes corrupt or stops with an unrecoverable error state, and further attempts to write to the console do nothing:
printf("XXX\n");
printf("abc\xC0\n");
printf("XXX\n");
fflush(stdout);
will output this on Xcode's console:
xxx
The return values of printf (not shown) do not indicate an error.
The same program running in Terminal, will output this:
XXX
abc?
XXX
which is OK.
According to Unicode v6.0.0, a decoder can stop with an error, or alternatively substitute the minimal malformed subsequence with a replacement character. For Xcode's Console, it would make sense to substitute invalid code units, otherwise the Console becomes useless.
Andreas _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden