'DB2 json values fetch contains strange characters "NEL" when viewed through Notepad++

We have a problem while viewing the JSON file that contains "\r\n" fetched from DB2 (encoding scheme EBCDIC). When we check the content of the attribute with TOAD directly in the database, we see that we have correct Hex-values for CRLF.

0D and 0A are hex values for CRL

We are fetching this data from DB2 as json format . While viewing the json file it gets converted to the below format

C2 and 85 gets formed . Could notice a spurious charcter Â...

And NotedPadd++(UTF-8) while viewing the JSON "NEL" is being displayed . When i convert the file to ANSI i could notice Â...

I am writing to file as in below code (sample code.)

            output = new FileOutputStream(tempFile);
            IOUtils.write(getBytes(), output);

    public byte[] getBytes() {
    String data = "{\r\n" "dataLists" : [ ]}";
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    byteArrayOutputStream.write(data.getBytes("UTF-8"));
    return byteArrayOutputStream.toByteArray();
   }

Please help.



Solution 1:[1]

JSON is based on JavaScript, and as part of the JavaScript definition it says that NEL characters could be translated into white spaces.

Based on that, if you don't want to have problems while viewing data imported from mainframe, you can convert the NEL characters into a white space.

enter image description here

Also, in this definition we can see that it can be converted into a white space

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AngocA