Garry's Mod Wiki


vararg utf8.codepoint( string string, number startPos = 1, number endPos = 1 )


Returns the codepoints (as numbers) from all characters in the given string that start between byte position startPos and endPos. It raises an error if it meets any invalid byte sequence. This functions similarly to string.byte.


1 string string
The string that you will get the code(s) from.
2 number startPos = 1
The starting byte of the string to get the codepoint of.
3 number endPos = 1
The ending byte of the string to get the codepoint of.


1 vararg
The codepoint number(s).


Demonstrates usage of the function.

print( utf8.codepoint( "Мёнём", 1, -1 ) )
Output: 1052 1105 1085 1105 1084

Page Links

Special Pages



Render Time: 41ms

DB GetPage 4
Generate Html 5
SaveChanges (1) 14
Render Body 0
Render Sidebar 14