You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix String.format() to use explicit byte indexing and not assume String.__getitem__ indexes directly to byte offset.
Python's String indexes by unicode codepoints (UTF-32) our String implementation currently uses UTF-8 and it's __getitem__ returns by byte offset. We need to be compliant with Python's indexing using unicode codepoints and String.format() needs to be fixed.
@rd4com I saw it's code you commited, do you wanna take this or should I ?
Steps to reproduce
Include relevant code snippet or link to code that did not work as expected.
If applicable, add screenshots to help explain the problem.
If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
Include anything else that might help us debug the issue.
System information
- What OS did you do install Mojo on ?
- Provide version information for Mojo by pasting the output of `mojo -v`
- Provide Modular CLI version by pasting the output of `modular -v`
The text was updated successfully, but these errors were encountered:
…tor for performance and readability, and prepare for full format spec support (#49225)
[External] [stdlib] Fix `String.format()` to use byte indexing, refactor
for performance and readability, and prepare for full format spec
support
Fix `String.format()` to use byte indexing, refactor for performance and
readability, and prepare for full format spec support.
Closes#3296.
ORIGINAL_AUTHOR=martinvuyk
<[email protected]>
PUBLIC_PR_LINK=#3539
Co-authored-by: martinvuyk <[email protected]>
Closes#3539
MODULAR_ORIG_COMMIT_REV_ID: 2d7ebae6f48b7d29866c089cffd084cb4405ac45
…tor for performance and readability, and prepare for full format spec support (#49225)
[External] [stdlib] Fix `String.format()` to use byte indexing, refactor
for performance and readability, and prepare for full format spec
support
Fix `String.format()` to use byte indexing, refactor for performance and
readability, and prepare for full format spec support.
Closes#3296.
ORIGINAL_AUTHOR=martinvuyk
<[email protected]>
PUBLIC_PR_LINK=#3539
Co-authored-by: martinvuyk <[email protected]>
Closes#3539
MODULAR_ORIG_COMMIT_REV_ID: 2d7ebae6f48b7d29866c089cffd084cb4405ac45
Bug description
Fix
String.format()
to use explicit byte indexing and not assumeString.__getitem__
indexes directly to byte offset.Python's String indexes by unicode codepoints (UTF-32) our String implementation currently uses UTF-8 and it's
__getitem__
returns by byte offset. We need to be compliant with Python's indexing using unicode codepoints andString.format()
needs to be fixed.This is related to PR #3295 and issue #3246
@rd4com I saw it's code you commited, do you wanna take this or should I ?
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: