2. Implementation - naver/lispe GitHub Wiki

String Issues

The whole interpreter has been implemented in C++11 and is based on STL templates for most of it. In particular, we have chosen to implement strings as std::u32string objects, since std::wstring poses some issues on Windows.

On most platforms, wstring is implemented as an array of wchar_t, which are recorded as 32 bits elements. However, on Windows, wchar_t are implemented as UTF16 characters, on 16 bits. This poses some problems for large Unicode characters, which might require two wchar_t of 16 bits each.

This poses some problems when accessing a character at a specific position in a string on Windows. To avoid these problems, we use a std::u32string object, where each character is encoded on a 32 bits value. However, the LispE implementation offers many routines to convert these strings in wstring objects.