GitHub user zsxwing opened a pull request:
https://github.com/apache/spark/pull/2781
[Spark 3922] Refactor spark-core to use Utils.UTF_8
A global UTF8 constant is very helpful to handle encoding problems when
converting between String and bytes. There are several solutions here:
1. Add `val UTF_8 = Charset.forName("UTF-8")` to Utils.scala
2. java.nio.charset.StandardCharsets.UTF_8 (require JDK7)
3. io.netty.util.CharsetUtil.UTF_8
4. com.google.common.base.Charsets.UTF_8
5. org.apache.commons.lang.CharEncoding.UTF_8
6. org.apache.commons.lang3.CharEncoding.UTF_8
IMO, I prefer option 1) because people can find it easily.
This is a PR for option 1) and only fixes Spark Core.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zsxwing/spark SPARK-3922
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/2781.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2781
----
commit 65b6b8ef68aa71ac45d292eefd7b3e4de0de3bf8
Author: zsxwing <[email protected]>
Date: 2014-10-13T06:53:11Z
Add UTF_8 to Utils
commit 80f4af8812d3f36a3807e574478a10511916dfbc
Author: zsxwing <[email protected]>
Date: 2014-10-13T06:53:26Z
Refactor spark-core to use Utils.UTF_8
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]