Skip to content

Use StandardCharsets where possible#15

Merged
xiangyushawn merged 2 commits intomicrosoft:devfrom
marschall:StandardCharsets
Nov 23, 2016
Merged

Use StandardCharsets where possible#15
xiangyushawn merged 2 commits intomicrosoft:devfrom
marschall:StandardCharsets

Conversation

@marschall
Copy link
Copy Markdown
Contributor

Since Java 1.7 there is the StandardCharsets class which provides
constants for frequently used Charsets. Using this also allows us to
remove several UnsupportedEncodingException catch blocks.

  • use StandardCharsets in String constructors where possible
  • use StandardCharsets in #getBytes where possible
  • use StandardCharsets instead of Charset.foreName where possible

Since Java 1.7 there is the StandardCharsets class which provides
constants for frequently used Charsets. Using this also allows us to
remove several UnsupportedEncodingException catch blocks.

 * use StandardCharsets in String constructors where possible
 * use StandardCharsets in #getBytes where possible
 * use StandardCharsets instead of Charset.foreName where possible
@YoungGah YoungGah added the Under Review Used for pull requests under review label Nov 22, 2016
Copy link
Copy Markdown
Contributor

@xiangyushawn xiangyushawn left a comment

Choose a reason for hiding this comment

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

Perfect! @marschall Accepted the PR, thanks for your contribution.

@xiangyushawn xiangyushawn merged commit 5b74f75 into microsoft:dev Nov 23, 2016
rene-ye added a commit that referenced this pull request Mar 6, 2018
lilgreenbird pushed a commit to lilgreenbird/mssql-jdbc that referenced this pull request Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Under Review Used for pull requests under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants