IsCrAndLfComplex or what?

by Michael S. Kaplan, published on 2008/12/02 03:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/12/02/9163572.aspx


The question from the other day from Patrick was:

I have a class defined as
    public class Foo
    {
        private string name = "a\r\nb\r\nc";
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }
    }

When I push object foo:Foo into a property grid control. It's showing empty squares for \r\n. Something like

a grid with boxes

This only happens in one of my XP machines. It does not happen in the other XP machine and a Vista machine I have (ie they're showing fine grid without boxes).

anyone has idea why this happen? I am suspecting it's an OS language setting issue...

Well, Patrick's instincts are pretty good here!

Just as we learned when dealing with vertical text (ref: What happens when you involve an unenabled Uniscribe with vertical text, given that Uniscribe doesn't handle vertical text?) and Unicode control characters like the RIGHT TO LEFT MARKER (ref: IsComplexEnoughForYou?), it turns out that sometimes even some of the most seemingly non-complex of all of the characters out there (the CARRIAGE RETURN and the LINE FEED) can depend on the special handling provided by Uniscribe handling.

When the checkbox in the middle tab of Regional and Language Options:

RLO 

The one that says Install files for complex script and right-po-left languages (including Thai) on it, you know?

It is really saying "turn on Uniscribe in lots of the default handling of text" whether it is Uniscribe or not!

In the end, it is fair to say that this description of "complex scripts" really gets worse all the time, it really does.

Thankfully we don't need to fix it since in Vista the option is no longer available to turn off -- it is always there....

But how intuitive is it to think of CR and LF as complex script characters? :-)

 

This blog brought to you by U+0013 and U+0010, aka CARRIAGE RETURN and LINE FEED


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2011/08/31 And then, the unrelated KB article fixes the problem...

2010/03/25 Q: Why do the small black squares disappear? Hint: The answer isn't complicated, it's complex...

go to newer or older post, or back to index or month or day