Character codes: Difference between revisions

m
No edit summary
Line 1,169:
97 98 99 9786</syntaxhighlight>
 
<code>7 u:</code> converts from utf-8 to utf-16 (<code>9 u:</code> would instead have converted to utf-32), <code>3 u:</code> by itself would give us:
 
<syntaxhighlight lang="j"> 3 u: 'abc☺'
Line 1,180:
a.i.'abc'
97 98 99</syntaxhighlight>
 
=={{header|Java}}==
<tt>char</tt> is already an integer type in Java, and it gets automatically promoted to <tt>int</tt>. So you can use a character where you would otherwise use an integer. Conversely, you can use an integer where you would normally use a character, except you may need to cast it, as <tt>char</tt> is smaller.
6,951

edits