isocpp / isocpp/CppCoreGuidelines
New guidelines regarding characters and strings
Open
@gdr-at-ms is already working on this.
Since Sep 12, 2016.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
I will say out multiple possible guidelines, might have gotten some wrong, because not reading with care. But all you can improve them or discard. Under portability I also mean some sort of direct communication between two programs on two different platform.
- Use Unicode ( u8"", u"" and U"") instead of implementation defined( "" and L"") characters and strings
Reason: Portability. - Don´t compare characters of different type with each other.
Reason: They are likely to have different values. - Don´t compare u8"" and "" strings between each other.
Reason: They might not be same. - Don´t compare signed, unsigned and plain characters and strings with each other.
Reason: They might not be same. - Prefer to use same type of character and string for one project
Reason: Its easy to accidentally mix them up. - Prefer to have characters unsigned?
Reason: Portability. Plain char is implementation defined. - Don't use byte/single character based string manipulations on variable length encodings like UTF-8, UTF-16.
Exception: UTF-32 as it is fixed-length?
Reason: Letter might be combination of multiple characters. - Care with endianness for UTF-16 and UTF-32?
Reason: Portability
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.