Skip to content

Conversation

darnuria
Copy link
Contributor

Script used for that made by @SimonSapin.
here:
https://www.reddit.com/r/rust/comments/2p3b3s/convert_to_uabcd12_style_unicode_escapes/

Copy here

git grep -l '\\u' | xargs sed -i \
    -e 's/\\u000\([0-9a-fA-F]\)/\\u{\1}/g' \
    -e 's/\\u00\([0-9a-fA-F]\{2\}\)/\\u{\1}/g' \
    -e 's/\\u0\([0-9a-fA-F]\{3\}\)/\\u{\1}/g' \
    -e 's/\\u\([0-9a-fA-F]\{4\}\)/\\u{\1}/g' \
    -e 's/\\U0000000\([0-9a-fA-F]\)/\\u{\1}/g' \
    -e 's/\\U000000\([0-9a-fA-F]\{2\}\)/\\u{\1}/g' \
    -e 's/\\U00000\([0-9a-fA-F]\{3\}\)/\\u{\1}/g' \
    -e 's/\\U0000\([0-9a-fA-F]\{4\}\)/\\u{\1}/g' \
    -e 's/\\U000\([0-9a-fA-F]\{5\}\)/\\u{\1}/g' \
    -e 's/\\U00\([0-9a-fA-F]\{6\}\)/\\u{\1}/g' \
    -e 's/\\U0\([0-9a-fA-F]\{7\}\)/\\u{\1}/g' \
    -e 's/\\U\([0-9a-fA-F]\{8\}\)/\\u{\1}/g'

@darnuria
Copy link
Contributor Author

conflit with #19980 and #19974 .
This will merge nicely in a roll-up?

@steveklabnik
Copy link
Contributor

Awesome, thank you so much!

@darnuria
Copy link
Contributor Author

@steveklabnik all the rewards are for @SimonSapin and his script. ;)

@alexcrichton
Copy link
Member

Needs a rebase

Script used for that made by @SimonSapin.
here:
https://www.reddit.com/r/rust/comments/2p3b3s/convert_to_uabcd12_style_unicode_escapes/

Copy of the script here

```bash
git grep -l '\\u' | xargs sed -i \
    -e 's/\\u000\([0-9a-fA-F]\)/\\u{\1}/g' \
    -e 's/\\u00\([0-9a-fA-F]\{2\}\)/\\u{\1}/g' \
    -e 's/\\u0\([0-9a-fA-F]\{3\}\)/\\u{\1}/g' \
    -e 's/\\u\([0-9a-fA-F]\{4\}\)/\\u{\1}/g' \
    -e 's/\\U0000000\([0-9a-fA-F]\)/\\u{\1}/g' \
    -e 's/\\U000000\([0-9a-fA-F]\{2\}\)/\\u{\1}/g' \
    -e 's/\\U00000\([0-9a-fA-F]\{3\}\)/\\u{\1}/g' \
    -e 's/\\U0000\([0-9a-fA-F]\{4\}\)/\\u{\1}/g' \
    -e 's/\\U000\([0-9a-fA-F]\{5\}\)/\\u{\1}/g' \
    -e 's/\\U00\([0-9a-fA-F]\{6\}\)/\\u{\1}/g' \
    -e 's/\\U0\([0-9a-fA-F]\{7\}\)/\\u{\1}/g' \
    -e 's/\\U\([0-9a-fA-F]\{8\}\)/\\u{\1}/g'
```
@darnuria
Copy link
Contributor Author

@alexcrichton : That will do the job. I cherry-picked my commit edited the conflict and re-pushed.

@frewsxcv
Copy link
Contributor

frewsxcv commented Jan 6, 2015

It looks like the unicode deprecation warnings were addressed in 7d8d06f . This can be closed.

@alexcrichton
Copy link
Member

Thanks @frewsxcv!

@alexcrichton
Copy link
Member

And also thanks @darnuria :)

lnicola added a commit to lnicola/rust that referenced this pull request Jun 16, 2025
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.

5 participants