-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[stdlib] Add utf8 safeguards, fix chr
method, add unicode and utf16 parsing for String
#3239
base: nightly
Are you sure you want to change the base?
Conversation
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
chr
methodchr
method, add unicode and utf16 parsing for String
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
@martinvuyk do you mean for this to be a draft still, or still pursuing this? Happy to review it after it's rebased. |
@JoeLoser I'm still mulling this one over. Python's behavior is quite varied around this functionality:
Some things hold me back on implementing these fully:
I'm leaning towards creating Another possibility is going for
I can make a proposal for the special pointer (or some other mechanism to signal ownership) and renaming of |
Add utf8 safeguards, the second of many steps to fix #2842
fn chr(c: Int) -> String
function now returns a replacement character (�)if the Unicode codepoint is invalid.
Added
String.from_unicode(values: List[Int]) -> String
andString.from_utf16(values: List[UInt16]) -> String
functions that return a Stringcontaining the concatenated characters. If a Unicode codepoint
is invalid, the parsed String has a replacement character (�) in that index.