[Mono-list] i18n Console.WriteLine problem

Paul paul at all-the-johnsons.co.uk
Thu Apr 5 02:47:30 EDT 2007


Hi,

I've searched quite a bit on this and can find quite a few examples of
using i18n in C#. The problem is that none of them deal with the
conversion of strings which means that the UTF-8 console (which needs to
be ISO-8859-15/EURO) is just missing out characters.

The code I've seen so far goes along these lines

using System;
using System.Globalization;

public class foo
{
  static void Main()
  {
     CultureInfo current = CultureInfo.CurrentCulture;
     CultureInfo germany = new CultureInfo ("de-DE");
     double money = 123.45;
     string localmoney = money.ToString("C", current);
     Console.WriteLine(localmoney + " Local money");
     localmoney = money.ToString("C", germany);
     Console.WriteLine(localmoney + " German money");
  }
}

Fine for converting a currency, but how do I convert text so that what
appears on the Console is correct?

The ultimate aim is to have this in a WinForm, but as I'm playing
currently, it makes more sense to do things on the Console for now.

On a side note, is there any problem in having an ArrayList inside of a
struct? When translating some words, there can be more than one correct
answer and an ArrayList looks to be the best way to store them.

I can't use Mono.Unix and gettext_ as this isn't supported under Win32.

TTFN

Paul
-- 
Sie können mich aufreizen und wirklich heiß machen!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070405/cfc87d02/attachment.bin 


More information about the Mono-list mailing list