Character codes: Difference between revisions
Content added Content deleted
(+Stata) |
|||
Line 1,627: | Line 1,627: | ||
=={{header|Stata}}== |
=={{header|Stata}}== |
||
The Mata '''ascii''' function transforms a string |
The Mata '''ascii''' function transforms a string into a numeric vector of UTF-8 bytes. For instance: |
||
<lang stata>: ascii("α") |
<lang stata>: ascii("α") |
||
Line 1,644: | Line 1,644: | ||
1 | 87 101 32 116 104 101 32 80 101 111 112 108 101 | |
1 | 87 101 32 116 104 101 32 80 101 111 112 108 101 | |
||
+-------------------------------------------------------------------------------+</lang> |
+-------------------------------------------------------------------------------+</lang> |
||
Conversely, the '''char''' function transforms a byte vector into a string: |
|||
<lang stata>: char((73,32,115,116,97,110,100,32,104,101,114,101)) |
|||
I stand here</lang> |
|||
=={{header|Swift}}== |
=={{header|Swift}}== |