You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/05/21 18:31:00 UTC

[jira] [Work logged] (HIVE-24903) Change String.getBytes() to DFSUtil.string2Bytes(String) to avoid Unsupported Encoding Exception

     [ https://issues.apache.org/jira/browse/HIVE-24903?focusedWorklogId=600580&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-600580 ]

ASF GitHub Bot logged work on HIVE-24903:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/May/21 18:30
            Start Date: 21/May/21 18:30
    Worklog Time Spent: 10m 
      Work Description: belugabehr commented on pull request #2127:
URL: https://github.com/apache/hive/pull/2127#issuecomment-846154250


   -1
   
   No need to add a library for this.  Just use StandardCharsets.UTF_8;


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 600580)
    Time Spent: 20m  (was: 10m)

> Change String.getBytes() to DFSUtil.string2Bytes(String) to avoid Unsupported Encoding Exception
> ------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-24903
>                 URL: https://issues.apache.org/jira/browse/HIVE-24903
>             Project: Hive
>          Issue Type: Bug
>            Reporter: dbgp2021
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: 1.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Hello,
> I found that DFSUtil.string2Bytes(String) can be used here instead of String.getBytes(). Otherwise, the API String.getBytes() may cause potential risk of UnsupportedEncodingException since the behavior of this method when the string cannot be encoded in the default charset is unspecified. One recommended API is DFSUtil.string2Bytes(String) which provides more control over the encoding process and can avoid this exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)