2

Please give me a sample C program to produce the euro sysmbol. I'm using windows keyboard and program needs to be compiled in linux.

Update: Actually I need Euro symbol as a string and need to concatenate it with amount string.

I'm having Dell Latitude D620 laptop and tried using Alt+4, Alt+5, etc.. None of them prints the euro sysmbol.

Thi
  • 2,297
  • 7
  • 26
  • 36
  • 1
    Iirc on Unix-likes the character set and character encoding to use depends on the locale, so do `setlocale` first with an appropriate argument and then just output U+20AC in the correct encoding. – Joey Jan 27 '11 at 08:07
  • [This](http://en.wikipedia.org/wiki/Wide_character#C.2FC.2B.2B) might give you an idea on how to implement this. – Lucas Jan 27 '11 at 08:57

3 Answers3

5

This is entirely character encoding specific.

This question should sum up why there is no straight answer to your question:

Hex representation of Euro Symbol €

Community
  • 1
  • 1
Drakonite
  • 1,309
  • 9
  • 15
2

The Unicode standard code-point for the Euro sign (€) is U+20AC.

If your system is running using UTF-8 as its native encoding, you can represent this glyph using the string "\xE2\x82\xAC". The encoding uses three bytes to represent the 16-bit value of the code-point.

unwind
  • 391,730
  • 64
  • 469
  • 606
1

Use "\u20AC"; this is UTF-8 encoding of Euro sign. More info here.

darioo
  • 46,442
  • 10
  • 75
  • 103