Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size of strings #1648

Closed
Shea690901 opened this issue Jun 23, 2017 · 2 comments
Closed

size of strings #1648

Shea690901 opened this issue Jun 23, 2017 · 2 comments

Comments

@Shea690901
Copy link

As I understand it std::string, std::wstring, std::u16string and std::u32string are mainly intended to store utf-strings.
Since at least utf-8 and utf-16 have variable storage sizes for their code points the question for the "size of a string" storing either encoding is ambiguous:

  • On one hand there is the storage size of the string, which can be obtained by either std::basic_string::size() or std::basic_string::length().
    [Why two methods to get the same result?]
  • On the other hand the amount of stored code points.
    Sadly without a standard way to ask for, or have I missed something?
@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 23, 2017

This issues list is for editorial issues only. Your question may be better suited to std-discussion or perhaps to Stack Overflow.

@tkoeppe tkoeppe closed this as completed Jun 23, 2017
@Shea690901
Copy link
Author

Thanks for info and link...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants