-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Feature/Unicode escape support #166
Feature/Unicode escape support #166
Conversation
Update to latest changes
|
||
// Is this a unicode escape sequence? | ||
if (i + 1 < format.Length && format[i + 1] == 'u') | ||
lastI = i + 6; // \u0000 format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be safe to do
i += 6 and break here to save having to iterate over the numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe enough. It's the same as with other escaped characters. Illegal escape sequences throw when trying to unescape the literal by the formatter. I don't see an advantage already throwing in the parser.
Codecov Report
@@ Coverage Diff @@
## version/v3.0 #166 +/- ##
===========================================
Coverage 94% 95%
===========================================
Files 42 42
Lines 1826 1839 +13
===========================================
+ Hits 1725 1738 +13
Misses 101 101
Continue to review full report at Codecov.
|
Very nice, thanks! Should definitely become part of SF. |
* Added support for Unicode Escape sequences * Updated test with unicode escape sequence support and fixed some typos * Fixed typo * Some additional tests to keep code coverage happy * Rebased to version/v3.0
We often want to write Unicode escape characters in our text e.g
\u2022
will become •.This adds support to the Parser and LiteralText to handle Unicode in the form
\uXXXX
I also fixed some typos in the surrounding code.