Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Euro Symbol

  • 17-01-2002 2:37pm
    #1
    Closed Accounts Posts: 64 ✭✭


    hi
    i'm doing a project for college and i need to put prices up in Euro. but every time i run my screens the € symbol never comes out right! is there something else i need to put in my code to make it work?? i'm using Borland C++

    Thanks


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    What are you using to print it out? Are you typing <alt-gr>+4 or <alt>+0128 or what?
    Try using the unicode value: 20A0


  • Closed Accounts Posts: 64 ✭✭wee_lady


    i'm usin <ctrl> + <alt> + 4. i remember having a similar problem trying to get the £ sign to print!


  • Registered Users, Registered Users 2 Posts: 4,487 ✭✭✭Mountjoy Mugger


    On a related matter - I've noticed that the € doesn't seem to appear when using O.E. - I get some non descript symbol instead.

    The MSKB seems to insist that all its current realtime fonts are Euro compatible so there should be no problem.

    Ideas, anyone? Or, is it just that those posting the symbol are at fault (using older fonts)?


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Use a font that supports it. Most European Unicode fonts should at this stage.


  • Registered Users, Registered Users 2 Posts: 19,549 ✭✭✭✭Krusty_Clown


    Correct unicode value is : 20AC, isn't it?

    See: http://www.microsoft.com/globaldev/reference/sbcs/1252.htm
    It's in the charmap as 20AC also...

    Wee lady : Does the machine support the Euro symbol?
    What code are you using to display the euro symbol?


  • Advertisement
  • Closed Accounts Posts: 64 ✭✭wee_lady


    all i'm trying to do is display prices on the screen
    eg price of video - €4.50 etc
    it is just a normal printf statement. but no matter wot i do i cant get the € sign to print! it comes up as some unidentifiable symbol. looks cool but unfortunatly wont get me n e marks!


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    Correct unicode value is : 20AC, isn't it?

    Yup, sorry, was looking at the value for EURO CURRENCY SIGN which is now cross referenced to 20AC EURO SIGN :rolleyes:

    20AC it is.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    it is just a normal printf statement

    On some 1-byte wide character sets € occupies position 0x80 (128), just above the ASCII 0-0x7F range. Windows Western (on Euro-ready machines) is an example of such a character set and with that set a printf with that character should work.

    On some other 1-byte wide sets € is not available.

    On Unicode, which is the set most often used for wprintf, € occupies position 0x20AC, and that value should work with that function. The rest of your string will have to be converted from char* or char[] to wchar_t* or wchar_t[].


  • Closed Accounts Posts: 296 ✭✭moist


    Use a font that supports iso8859-15


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Using iso8859-15 you'd want to use character 0xA4.

    Given the inconsistencies between character sets you have two choices:

    1. Use a charset that you know will be installed on the OS the program is running on (e.g. Windows will always have Windows Western, with € and 0x80), this restricts you to one OS.

    2. Use Unicode (€ at 0x20AC) replace your char* and char[] strings with wchar_t* and wchar_t[] strings (hopefully that will just be a matter of changing a typedef) and change printf to wprintf etc.

    In this day and age we should all be using Unicode anyway.


  • Advertisement
Advertisement