Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I need to display a pound symbol, and & symbol on button texts of a virtual keyboard.when I press them they should display the corresponding text pound symbol and ampersand symbol .

I have a string table(xml file) , for which the button text i am trying to display Pound (sterling) symbol) and for another button i want to display &(ampersand) symbol using utf-8 and C++ and xml.
In the xml string table when I type as follows
<element id="buttonText">&

it is giving the error (illegal syntax ,expecting a valid start name character)

Please let me know how i can use the button text & (ampersand) and pound(sterling symbol)
and when i press those buttons then the corresponding text should be displayed
(pound symbol , &)

Appreciate your help.

Thanks,
Sudhkar
Posted
Comments
Member 3975629 21-Apr-14 7:35am    
I am able to display & (ampersand) using &
But I am not sure how to display euro , pound ,cent symbols.
Please let me know any ideas/suggestions on this.

Thanks,
Sudhakar

1 solution

You can represent any character in XML, even the one reserved for XML syntax, using character entity (such as &#x00A3;):
http://dev.w3.org/html5/html-author/charref[^],
http://www.w3.org/TR/2014/REC-xml-entity-names-20140410[^].

See also: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references[^].

(Note that in XML you cannot use named those entities defined for HTML (like &pound;) but undefined in XML. You either need to define them or use a numeric character reference instead.)

—SA
 
Share this answer
 
v2
Comments
Andreas Gieriet 21-Apr-14 14:41pm    
My 5!
Cheers
Andi
Sergey Alexandrovich Kryukov 21-Apr-14 14:48pm    
Thank you, Andi.
—SA
CPallini 21-Apr-14 16:26pm    
5.
Sergey Alexandrovich Kryukov 21-Apr-14 16:50pm    
Thank you, Carlo.
—SA
Member 3975629 22-Apr-14 3:02am    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900