All for € and € for all – European Union story

The European Union, a big word that represent a community where I’m part of ! Our small country Belgium actually holds the center of this community, so in a way I’m proud.
But if you look closely there are gaps in the design… the community has a lot of problems that need to be resolved to keep it working fluently ( the design for one European law springs to mind ). Now let me share you a small story about something so trivial that it just seems silly that it hasn’t been corrected yet !

Let’s take an example as reference, just so everyone understands the example I’m addressing. The United States of America is one good example of a Union like structure ! And I mean the design, so no interpretation what soever about the current implementation. But like I said it’s a good reference.

What do you think should a Union have in common ? Well let me tell you, 3 things actually :
1. One monetary system
2. One metric system
3. One law ( maybe should include one police force/army )

Well apart from the one law, the EU is far from this design ! We still have a metric system that isn’t used in Great Britain and the Euro isn’t used there either. But you could argue that we are moving in the right direction… and that’s true, because things are moving and the result should be more like an Union.

But what bothers me the most is the inability the EU has in making any decisions ( my opinion ). Let’s get back to the one monetary system…
What on earth were they thinking when they decided to force the use of the Euro ? “Oh just let everyone do their thing with this new system…” ?? Well that is just the thought they had !!
Let me put it in one simple question : How would you write the amount sixty euros using numbers and the € sign ?
If you would think this is an easy question you are wrong !! If you think you have the correct answer fast, you could be dead wrong too !!

Examples of writing ( pick your choice ):

* € 60
* €60
* 60€
* 60 €

So in other words, there is no unified way of writing this mentioned in any EU document ( no to my knowledge ) ! Doesn’t this seem odd ? Why hasn’t this been presented… remember my reference, well how should it look like when the people of the USA would use a different writing on the East coast as the ones on the West coast ? It would just look plain stupid, well here in the EU this is just a common fact !! I just don’t get it, why hasn’t this been addressed during the roll out of the Euro ? It would only seem natural to have the same writing in all EU countries.

So for all the non believers ( I was one to start with ), let me show you my search path and you shall see that this ‘typo’ is true !
Let’s start with the obvious search of all, Wikipedia ( not the most correct source, but by far the easiest to search ).
The result can be found here and it states : Placement of the sign is also an example of diversity. Partly since there are no official standards on placement, countries have generated varying conventions or sustained those of their former currencies.

Nice, my first search result already acknowledges my speculation… but still my hope wasn’t gone yet. So I searched the reference material in my own country and I found 2 specific websites that can be seen here ( KU Leuven ) and here ( taaladvies.net ), mind you both in dutch. But here the result is that we in Belgium should use the writing like this € 60, so in other words first the Euro sign, then a space and then the amount.
Thank God I thought, there is an unified way, even though it would only be in Belgium ( but I guess each country has it own standard ). So I lived happily ever after, NOT ! Only a few days after this, just by accident I found another website ! But this time one on a higher level, one of the European commission, one to my knowledge of the people who reside in our own capital Brussels. So even though I was expecting some back up to my previous search results, this got worse. Their standard is to use 2 different writings, one for the English language and one for all others ( who in the world writes these standards ) !!
So if you are a English writer you should write : € 60 but all others ( me included ) should write 60 € !
The details can be found here

Nice… so now I’m stuck with a moral problem… do I follow my instinct and the dutch pages I found and still write € 60 or do I use the European standard ( mind you this is a publications office standard, that is only supposed to be used internally ) 60 €.

What do you people think ??

Technorati Tags: , ,

Default user Locale through .Net

kick it on DotNetKicks.com

For who doesn’t know this yet, I’m a software programmer !
Currently I’m working with Visual Studio 2005 and develop software with C#.

And every now and then you get stuck in a situation that seems hopeless :). Even with a large team of capable people and the vast code example base available on the internet, some problems seem unsolvable !
So let me tell you a small story about one of this problems I recently had.

First the current layout of the project, we create software, but we actually sell a complete system to our customers. This means that we will ship a Dell desktop model together the software ! Then our service people will run the install scripts on site and configure it to the needs of the customer. But during the configuration, the service guy has to create several users through the configuration program. These users are stored in Windows XP as actual users, so when the service guys creates a new user, the default settings for this user are coming from Windows XP itself.
More technical detail : there is a .Default user defined in the Windows Registry that acts as a template for each new user !

Now the problem with this setting… Each time the service guy adds a user he has to set this user to the correct Locale, depending on the country where the software is going to get used ! This because the user account for the service people is put to English – US and it could be that each user has to be set to Dutch – Belgium.

To facilitate the install, we had the idea of manipulating Windows XP in such a manner that during configuration of our software the service guy can pick one Locale that will have the effect that each time he adds a new user it will already have those Locale settings.

For this problem I was asked to come up with a good solution in C# !!
And well to cut a long story short, I haven’t found one !!!!! So I was stuck.
The only real solution I found had to many pitfalls, we regarded it as a ‘no go’. It consist of creating a CultureInfo object from a given LCID and dumping all data into the Registry node of HKEY_USERS\.Default\Control Panel\International ! Even though I think this should/could work, I think that string manipulating each value to the correct format would lead to many possible errors.

What happens when I’m stuck… I go around the internet and search for topics that are closely linked. Well let me say that since the dawn of Blogs, we are blessed with information and knowledge that has impact on real life development !!
As a blogger myself, I know that writing a good article with some tutorial knowledge so since developers started using this medium my life got a lot easier :).
Because of my current working position I follow a lot of MSDN blogs that have a close or near relationship with .Net, Visual Studio or C#. One of those blogs is the one of Shawn Steele, and let me tell you his blog is superb ! Easy to follow and the example code/solutions he posts are all eye openers for me.

Well because he had already written many posts about cultural settings, I tried to contact him to see if he could shed some light on my problem. And guess what, I got a solution within 24 hours !!!!! That isn’t even damn fast, that is just amazingly brilliant !! His original answer is situated here.
Thanks again Shawn !!

After looking at the solution, there are 2 lesson to be made :

1. Not everything can be done with .Net ( so hence the reason why I got stuck 🙂 )
2. Not all solutions need to be difficult ( just one Windows script command line does exactly what we wanted )

Now for all other people out there who would stumble upon this same problem, here is the code I used in .Net to launch the script, enjoy.


public void StoreCultureInfo(int lcid)
{
try
{
//First create a CultureInfo object from the given LCID code
CultureInfo cultureInfo = CultureInfo.GetCultureInfo(lcid);

//Setting the .Default user in the Registry can't be done through .Net code in a straightforward manner !
//But there is a way to do this through use of command line syntax, the details can be found here : http://support.microsoft.com/default.aspx?scid=kb;en-us;289125
//Reminder : This option will only work for Windows XP, in Windows Vista detailed solution can be found here : http://www.microsoft.com/globaldev/vista/vista_tools/vista_command_line_international_configuration.mspx

//First we need to create a text file with the correct Locale for the Default user
//The locale should be specified in Hexadecimal format !
string hexadecimalLCID = cultureInfo.LCID.ToString("X");
string localeConfigurationFile = Path.Combine(PathHelper.TempDirectory, "regopts.txt");
//Be sure this configuration file doesn't exist yet
if (File.Exists(localeConfigurationFile))
FileHelper.DeleteFileEvenIfReadonly(localeConfigurationFile);

using (StreamWriter streamWriter = File.CreateText(localeConfigurationFile))
{
streamWriter.WriteLine("[RegionalSettings]");
streamWriter.WriteLine("UserLocale_DefaultUser = {0}", hexadecimalLCID);
streamWriter.Close();
}

//Now execute the command line option to swith the default user locale !
Process process = new Process();
process.StartInfo.FileName = "rundll32.exe";
process.StartInfo.Arguments = string.Concat("shell32,Control_RunDLL intl.cpl,,/f:", "\"", localeConfigurationFile, "\"");
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit();

int processExitCode = process.ExitCode;

if (processExitCode != 0)
throw new ApplicationException("Problem occured while setting the Default user locale !");
break;
}
}
catch (ApplicationException ex)
{
}
}

Technorati tags: , , , ,