You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "rahulcodespace (via GitHub)" <gi...@apache.org> on 2023/07/20 17:31:43 UTC
[GitHub] [commons-lang] rahulcodespace opened a new pull request, #1083: Add toUnicodeString method to StringUtils for Unicode conversion
rahulcodespace opened a new pull request, #1083:
URL: https://github.com/apache/commons-lang/pull/1083
Introduce a new method `toUnicodeString` to the `StringUtils` class. This method efficiently converts strings, especially those containing emojis or other special characters, to their Unicode representation.
- Utilizes the `codePointAt` method to cater to surrogate pairs.
- Ensures proper handling of empty strings.
- Returns the complete Unicode string with the respective prefix and formatted in hexadecimal.
This addition will aid in scenarios where a consistent Unicode representation of strings is required, enhancing the utility of the `StringUtils` class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] codecov-commenter commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1644346298
## [Codecov](https://app.codecov.io/gh/apache/commons-lang/pull/1083?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#1083](https://app.codecov.io/gh/apache/commons-lang/pull/1083?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (69dd8c2) into [master](https://app.codecov.io/gh/apache/commons-lang/commit/f909f466e3d0bdaf8789ed1ae3ebcbbef0966665?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f909f46) will **increase** coverage by `0.02%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #1083 +/- ##
============================================
+ Coverage 92.07% 92.10% +0.02%
- Complexity 7501 7506 +5
============================================
Files 194 195 +1
Lines 15736 15729 -7
Branches 2902 2899 -3
============================================
- Hits 14489 14487 -2
+ Misses 674 669 -5
Partials 573 573
```
| [Impacted Files](https://app.codecov.io/gh/apache/commons-lang/pull/1083?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...ain/java/org/apache/commons/lang3/StringUtils.java](https://app.codecov.io/gh/apache/commons-lang/pull/1083?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvU3RyaW5nVXRpbHMuamF2YQ==) | `98.86% <100.00%> (+<0.01%)` | :arrow_up: |
... and [53 files with indirect coverage changes](https://app.codecov.io/gh/apache/commons-lang/pull/1083/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] garydgregory closed pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory closed pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
URL: https://github.com/apache/commons-lang/pull/1083
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] rahulcodespace commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "rahulcodespace (via GitHub)" <gi...@apache.org>.
rahulcodespace commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1645079601
> This duplicates Commons Lang and Text's `UnicodeEscaper` class. -1 unless I am missing something.
> This duplicates Commons Lang and Text's `UnicodeEscaper` class. -1 unless I am missing something.
`UnicodeEscaper` class has one method `protected String toUtf16Escape(final int codePoint)` but it takes codePoint as a argument and returns unicode string in hex form and I observed the entire class has been deprecated.
The `StringUtils.toUnicodeString()` takes `String` input and returns unicode string in hex form '\\uxxxx'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1644671601
This duplicates Commons Lang and Text's `UnicodeEscaper` class.
-1 unless I am missing something.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] rahulcodespace commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "rahulcodespace (via GitHub)" <gi...@apache.org>.
rahulcodespace commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1645797578
> Hello @rahulcodespace
>
> Yes, this functionality is deprecated in Commons Lang, but, I also mentioned Commons **Text**, which is where the functionality is currently located and supported.
>
> You might have failed to consider that the `UnicodeEscaper` and `UnicodeUnescaper` classes extend other classes that provide the class' full functionality.
>
> Please look at the unit tests, and you'll see that this feature is already supported.
okay. Good to know that functionality already exists, I'm closing this PR.
This was my first attempt to cotribute to open source project. I would be happy to contribute to this repo in future.
Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1645805672
Closing per @rahulcodespace comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-lang] garydgregory commented on pull request #1083: Add toUnicodeString method to StringUtils for Unicode conversion
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1083:
URL: https://github.com/apache/commons-lang/pull/1083#issuecomment-1645638994
Hello @rahulcodespace
Yes, this functionality is deprecated in Commons Lang, but, I also mentioned Commons **Text**, which is where the functionality is currently located and supported.
You might have failed to consider that the `UnicodeEscaper` and `UnicodeUnescaper` classes extend other classes that provide the class' full functionality.
Please look at the unit tests, and you'll see that this feature is already supported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org