Tuesday, August 16, 2011

Getting Ready For Windows 8

It doesn’t feel all that long ago when Windows 7 was released. Now, Microsoft are getting ready to introduce the world to Windows 8. Check out the Building Windows 8 blog where MS will be posting allsorts about the next OS. Back in 2008 MS began writing about Windows 7 using the same blog, which proved very popular, so they have decided to repeat this idea. Considering the lack of detail MS have thus far released about Windows 8, I’m sure many people will regularly keeping an eye on the new blog!

Saturday, August 13, 2011

When Are The Letters “F” and “G” Are Considered Equal

A friend of mine noticed an unusual anomaly whilst writing a .NET app which was using the Welsh (cy-GB) culture. Here’s a snippet:

public class Program
{
    static void Main(string[] args)
    {
        var cultureInfo = new CultureInfo("cy-GB");

        Thread.CurrentThread.CurrentCulture = cultureInfo;
        Thread.CurrentThread.CurrentUICulture = cultureInfo;

        Console.WriteLine(String.Equals("f", "g", StringComparison.CurrentCultureIgnoreCase));
        Console.ReadLine();
    }
}
You would expect “f” and “g” to be different, however in this universe they are considered the same! A quick rummage around the Google attic revealed this Microsoft Connect report where someone else has reported the same problem. Microsoft have acknowledged this to be a bug in the framework, which will be resolved in the next version. In the meantime, I’m not aware of any straightforward workarounds other then having to specifically cater for the letter’s “f” and “g” in your code when doing any comparisons. That’s a bit crap Sad smile