I have the following unicode character that I want to use in a string: 🚕
I have found its hex and decimal code through this:
While I know how to use the "&" symbol in a string in strings.xml
by doing this:
<string name="Example">Example character &</string>
I cannot use the car symbol.
How can I use this unicode character in a string in strings.xml?
Update One:
Following the first solution of using this: 🚗
I got the following error:ERROR IN APPLICATION: input is not valid Modified UTF-8:
Characters are denoted using the notation used in the Unicode Standard, that is, an optional U+ followed by their hexadecimal number, using at least 4 digits, such as "U+1234" or "U+10FFFD". In XML or HTML this could be expressed as "ሴ" or "􏿽".
Actually there are some elements in XML which have unicode characters along with the data. It is not clear which characters you do consider as Unicode characters and which you don't. XML/XQuery only works with Unicode characters so everything in your string is an Unicode character.
@MSalters: std::string can hold 100% of all Unicode characters, even if CHAR_BIT is 8. It depends on the encoding of std::string, which may be UTF-8 on the system level (like almost everywhere except for windows) or on your application level.
Unicode Character 'AMPERSAND' (U+0026)
It's
<string name="Example">Example character \u0026</string>
See more unicode characters here:
http://www.utf8-chartable.de/unicode-utf8-table.pl?number=1024&utf8=0x
if you go Unicode site : https://unicode-table.com/en/#control-character and click at this Unicode that says U+00AE you mustn't write the + symbol if you want copy paste this example at strings.xml :) :) :)
<string name="example">"\u00AE"</string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With