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

Revert "replace ZWSP by "\u200B"" #9

Merged
merged 2 commits into from
Jun 5, 2023
Merged

Conversation

qbnu
Copy link
Contributor

@qbnu qbnu commented Jun 3, 2023

This reverts commit 19eca7f.

Unicode literals don't work properly in C++ strings. You will end up with a bunch of question marks on the ends of comments.

@HFrost0
Copy link
Owner

HFrost0 commented Jun 4, 2023

I previously found that compiling files with ZWSP (Zero Width Space) characters could result in errors on some systems, but this issue was resolved when using unicode literals. I'm not very familiar with C++, but I consulted ChatGPT and it suggested using std::string str = u8"\u200B";. I would like to hear your thoughts on this.

@qbnu
Copy link
Contributor Author

qbnu commented Jun 4, 2023

Apparently doing that can cause problems if you don't use Unicode strings throughout the entire program (https://stackoverflow.com/a/7636849). It might work, I'm not sure.

@qbnu
Copy link
Contributor Author

qbnu commented Jun 4, 2023

I tried u8"\u200B" and L"\u200B" which didn't work. Using the UTF-8 encoded bytes does though.

@HFrost0 HFrost0 self-requested a review June 5, 2023 02:31
Copy link
Owner

@HFrost0 HFrost0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@HFrost0 HFrost0 merged commit bb25b65 into HFrost0:main Jun 5, 2023
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

Successfully merging this pull request may close these issues.

2 participants