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

use wide chars in remove_punctuations #78552

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

junytse
Copy link
Contributor

@junytse junytse commented Dec 13, 2024

Summary

Bugfixes "Fix crashes in macOS due to parsing UTF8 string improperly"

Purpose of change

Fix #78547

Describe the solution

Describe alternatives you've considered

Since strings passed to remove_punctuations is utf-8 encoded, convert it to wstring before doing char-level operations. Convert the result back to utf-8 string afterwards.

Testing

The reproduce steps in #78547 no longer crash with the fix.

Additional context

There's similar fixes for macOS before: #57967

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) new contributor json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Dec 13, 2024
@Night-Pryanik Night-Pryanik merged commit 58e95c5 into CleverRaven:master Dec 14, 2024
25 of 26 checks passed
@junytse junytse deleted the remove_punctuations_fix branch December 14, 2024 03:44
@akrieger
Copy link
Member

This legit broke the Windows build @Night-Pryanik.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions new contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in macOS build
3 participants