Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

c# currency

  • 03-12-2011 06:03PM
    #1
    Registered Users, Registered Users 2 Posts: 4,250 ✭✭✭


    im sure there is a simple solution to this but when i use currency format i get a ? how do i change it to the euro symbol. using a consloe application if that makes a difference.


Comments

  • Registered Users, Registered Users 2 Posts: 1,346 ✭✭✭carveone


    im sure there is a simple solution to this but when i use currency format i get a ? how do i change it to the euro symbol. using a consloe application if that makes a difference.

    The console app might well make a difference - it used to in the past because GUI apps used Unicode and console used codepages. I'm not so sure about the situation now though.

    My guess is if you find out the proper value for the euro in the codepage you are using (probably 0x80 or decimal 128, as opposed to the proper unicode which is U+20AC) you should get something...

    There's definately a right way of doing it - ie: not using printf or whatever is the equivalent in C# - and I can't quite remember what it is...


  • Registered Users, Registered Users 2 Posts: 1,346 ✭✭✭carveone


    Essentially what I am saying is that standard I/O streams are, well, broken. But the console itself is definately UTF-16 capable. You just need to use the right calls..

    Edit:
    Which appear to be WriteFile... Microsoft's Kaplan has a blog about this stuff, it was in my bookmarks (which is why I couldn't find it ;) ):

    http://blogs.msdn.com/b/michkap/archive/2008/03/18/8306597.aspx
    http://blogs.msdn.com/b/michkap/archive/2010/04/07/9989346.aspx

    Hope this helps...


Advertisement