Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Unicode convert/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating|release}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> == Usage == Converts Unicode character codes, always given in hexadecimal, to their UTF-8 or UTF-16 representation in upper-case hex or decimal. Can also reverse this for UTF-8. The UTF-16 form will accept and pass through unpaired surrogates e.g. <code>{{#invoke:Unicode convert|getUTF8|D835}}</code> β {{#invoke:Unicode convert|getUTF16|D835}}. The reverse function <code>fromUTF8</code> accepts multiple characters, and can have both input and output set to decimal. When using from another module, you may call these functions as e.g. <code>unicodeConvert.getUTF8{ args = {'1F345'} }</code>, without a proper <code>frame</code> object. To find the character code of a given symbol (in decimal), use e.g. {{ml|ustring|codepoint|\π±}} β {{#invoke:ustring|codepoint|\π±}}. {| class=wikitable ! Code !! Output |- | {{mlx|Unicode convert|getUTF8|1F345}} || {{#invoke:Unicode convert|getUTF8|1F345}} |- | {{mlx|Unicode convert|getUTF8|1F345|base{{=}}dec}} || {{#invoke:Unicode convert|getUTF8|1F345|base=dec}} |- | {{mlx|Unicode convert|fromUTF8|F0 9F 8D 85 }} || {{#invoke:Unicode convert|fromUTF8|F0 9F 8D 85 }} |- | {{mlx|Unicode convert|fromUTF8|240 159 141 133|base{{=}}dec|basein{{=}}dec}} || {{#invoke:Unicode convert|fromUTF8|240 159 141 133|base=dec|basein=dec}} |- | {{mlx|Unicode convert|getUTF16|1F345}} || {{#invoke:Unicode convert|getUTF16|1F345}} |- | {{mlx|Unicode convert|getUTF16|1F345|base{{=}}dec}} || {{#invoke:Unicode convert|getUTF16|1F345|base=dec}} |} ==See also== {{unicode templates}} <includeonly>{{sandbox other| | <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Unicode character modules]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Ml
(
edit
)
Template:Mlx
(
edit
)
Template:Module rating
(
edit
)
Template:Unicode templates
(
edit
)
Module:Unicode convert
(
edit
)
Module:Ustring
(
edit
)