brain icon indicating copy to clipboard operation
brain copied to clipboard

Unicode Compatible String

Open sunjay opened this issue 9 years ago • 0 comments

The reason brain has been using u8 instead of a type called char is because we have been reserving char for when we finally have time to implement unicode support. The problem is that the concept of a "character" extends far beyond ascii so if we ever want this to be useful we should add support for unicode from the get go.

See Rust's implementation of a unicode char: https://doc.rust-lang.org/beta/std/primitive.char.html

The char type represents a single character. More specifically, since 'character' isn't a well-defined concept in Unicode, char is a 'Unicode scalar value', which is similar to, but not the same as, a 'Unicode code point'.

Possibly useful regarding the memory layout: https://www.youtube.com/watch?v=kPR8h4-qZdk

  • [ ] char type
  • [ ] str type

sunjay avatar Feb 26 '17 16:02 sunjay