Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Unicode Compatible String #47

Open
2 tasks
sunjay opened this issue Feb 26, 2017 · 0 comments
Open
2 tasks

Unicode Compatible String #47

sunjay opened this issue Feb 26, 2017 · 0 comments

Comments

@sunjay
Copy link
Owner

sunjay commented Feb 26, 2017

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant