You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claude Roux edited this page Oct 27, 2021
·
4 revisions
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.