GitHub user xvjie opened a pull request:

    https://github.com/apache/flume/pull/201

    【乱码问题】characters are not displayed properly____execSource.java

    I hope to confirm the following questions:
          When I use execSource to get data to elasticsearchSink:
          The source uses the "GBK" encoding, and the data on the es side will 
be garbled.
    I think:
            When the exec source configuration code is "GBK", the data should 
be encoded as "UTF-8" after reading the data, because the elasticsearchSink 
side does not have a code configuration. So I made the following changes to 
execSource.java in my personal use:
            eventList.add(EventBuilder.withBody(line.getBytes("UTF-8")));
    
--------------------------------------------------------------------------------------------英文表达不æ¸
…楚的话,以下是汉语原文
    我在使用execSource获取数据到elasticsearchSink时:
    source使用“GBK”编码,es端的数据会乱码。
    我认为:
           exec源端配置编ç 
ä¸ºâ€œGBK”时,在读取到数据以后应该将数据编码为"UTF-8",因
为elasticsearchSink端并没有编码é…
ç½®ã€‚所以我在个人使用中将execSource.java作出以下修改:
           eventList.add(EventBuilder.withBody(line.getBytes("UTF-8")));

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xvjie/flume trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flume/pull/201.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 #201
    
----
commit 9308d65da83f21497802569c5e2ed02a8c1806ec
Author: jie.xu <450172223@...>
Date:   2018-03-13T01:42:53Z

    【乱码问题】execSource
    
    I hope to confirm the following questions:
          When I use execSource to get data to elasticsearchSink:
          The source uses the "GBK" encoding, and the data on the es side will 
be garbled.
    I think:
            When the exec source configuration code is "GBK", the data should 
be encoded as "UTF-8" after reading the data, because the elasticsearchSink 
side does not have a code configuration. So I made the following changes to 
execSource.java in my personal use:
            eventList.add(EventBuilder.withBody(line.getBytes("UTF-8")));
    
--------------------------------------------------------------------------------------------英文表达不æ¸
…楚的话,以下是汉语原文
    我在使用execSource获取数据到elasticsearchSink时:
    source使用“GBK”编码,es端的数据会乱码。
    我认为:
           exec源端配置编ç 
ä¸ºâ€œGBK”时,在读取到数据以后应该将数据编码为"UTF-8",因
为elasticsearchSink端并没有编码é…
ç½®ã€‚所以我在个人使用中将execSource.java作出以下修改:
           eventList.add(EventBuilder.withBody(line.getBytes("UTF-8")));

----


---

Reply via email to