cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Stevens <migh...@gmail.com>
Subject Re: Cassandra java driver linux encoding issue
Date Thu, 17 May 2018 16:28:25 GMT
What is the value returned from Charset.defaultCharset() on both systems?

On Wed, May 16, 2018 at 5:00 AM rami dabbah <rzdabbah@gmail.com> wrote:

> Hi,
>
> I am trying to query text filed from Cassandra using java driver see code
> below. In windows it is working fine but in linux i am getting ??????
> instead of Chines characteres
>
>
> Code:
>
> ResultSet shopsRS =
> this.cassandraDAO.getshopsFromScanRawByScanId(cassandraSession,"scan_raw",scanid);
>     String record = null;
>     for (Row row : shopsRS){
> try {
> pProtocol.addEvent(new
> BaseEvent(BaseEvent.LEVEL_ERROR,"Charset.defaultCharset():"+Charset.defaultCharset()));
> record =row.getString("raw_data");
> Helper.verifyEncoding(record);
> String updated_record =
> Helper.addAttributeToJsonString(pProtocol,row.getString("raw_data"),CommonVars.AUX_DATA,CommonVars.AUX_DATA_BATCH_ID,batchId);
> Helper.verifyEncoding(updated_record);
> producer.sendMessage( updated_record);
> counter++;
> } catch (IOException e) {
> pProtocol.addEvent(new BaseEvent(BaseEvent.LEVEL_ERROR,"Could not send
> Message: "));
>             e.printStackTrace();
> }
>
>
>
> example text:
>
> "details_product_name":"佛罗伦萨万豪AC酒店(AC Hotel Firenze)|"
>
>
> --
> Rami Dabbah
> <http://www.linkedin.com/profile/edit?goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1&trk=spm_pic>
> Java Professional.
>

Mime
View raw message