Jump to content

UTF-8 encode and decode: Difference between revisions

(Added Julia language)
Line 533:
𝄞 U+1D11E F09D849E 𝄞
</pre>
 
=={{header|J}}==
'''Solution:'''
<lang j>utf8=: 8&u: NB. converts to UTF-8 from unicode or unicode codepoint integer
ucp=: 9&u: NB. converts to unicode from UTF-8 or unicode codepoint integer
ucp_hex=: hfd@(3 u: ucp) NB. converts to unicode codepoint hexadecimal from UTF-8, unicode or unicode codepoint integer</lang>
 
'''Examples:'''
<lang j> utf8 65 246 1046 8364 119070
AöЖ€𝄞
ucp 65 246 1046 8364 119070
AöЖ€𝄞
ucp 'AöЖ€𝄞'
AöЖ€𝄞
utf8 ucp 65 246 1046 8364 119070
AöЖ€𝄞
ucp_hex utf8 65 246 1046 8364 119070
00041
000f6
00416
020ac
1d11e
utf8@dfh ucp_hex utf8 65 246 1046 8364 119070
AöЖ€𝄞</lang>
 
=={{header|Java}}==
892

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.