Strings and Runes in AngelScript

A string in AngelScript is a sequence of characters. Unlike some other languages, AngelScript doesn't have a specific "rune" type, but it does support Unicode characters.

```angelscript
void main()
{
    // This is a string assigned a literal value
    // representing the word "hello" in the Thai language.
    // AngelScript string literals support Unicode characters.
    string s = "สวัสดี";

    // We can get the length of the string in characters
    print("Len: " + s.length() + "\n");

    // We can iterate through the string characters
    print("Characters: ");
    for (uint i = 0; i < s.length(); ++i)
    {
        print(s[i] + " ");
    }
    print("\n");

    // We can also use a range-based for loop to iterate through the string
    print("Using range-based for loop:\n");
    for (uint i = 0; i < s.length(); ++i)
    {
        print("Character at " + i + " is " + s[i] + "\n");
    }

    // This demonstrates passing a character to a function
    for (uint i = 0; i < s.length(); ++i)
    {
        examineChar(s[i]);
    }
}

void examineChar(uint8 c)
{
    // We can compare a character value directly
    if (c == 't')
    {
        print("found tee\n");
    }
    else if (c == '')
    {
        print("found so sua\n");
    }
}

When you run this script, you’ll see output similar to this:

Len: 6
Characters: ส ว ั ส ด ี 
Using range-based for loop:
Character at 0 is ส
Character at 1 is ว
Character at 2 is ั
Character at 3 is ส
Character at 4 is ด
Character at 5 is ี
found so sua
found so sua

Note that AngelScript handles Unicode strings differently from Go. In AngelScript, the length() method returns the number of characters, not bytes. Also, indexing into a string gives you characters, not bytes.

AngelScript doesn’t have a built-in way to get the Unicode code point of a character. If you need this functionality, you would typically need to implement it yourself or use a third-party library.

The examineChar function demonstrates how to compare characters. In AngelScript, characters are represented as uint8, which can hold values from 0 to 255. This means it can directly represent ASCII characters, but for Unicode characters beyond this range, you might need to use string comparison instead.

Remember that the exact behavior with Unicode strings can depend on how AngelScript is implemented in your specific environment. Some implementations might provide additional Unicode support.