PureConnect

 View Only
Discussion Thread View
  • 1.  handler does not accepts characters in utf-8 encoding

    Posted 12-18-2020 19:18
      |   view attached

     #HandlerQuestions

     #Handlers

     #AskMeAnything(AMA)

    Hello everyone,

    We have encountered on problem with accepting "slovak" character by "handler".

    For test I used simple java client where sent custom notification to handler. Value of body parameter includes "slovak" characters.

    Handler consists of custom notification step and database steps for saving value to database.

    Body of request is:

    //

    {"objectId":"customDiakritikaID","eventId":"customDiakritikaEvent""data":["key1:ľščťžýáíéúä"]}

    //

    It seems that handler has problem to accept "slovak" character, despite of the fact java client sent ones in "utf-8" encoding.

    As you can see from attached printscr, value of key is displayed correctly in "wireshark", but in "IRdesigner", ip.ininlog is not displayed correctly.

    Finally, the value of key saved in database (with "slovak" collation) is not correct as well.

    Can you explain what should be set/defined or configured in order IP subsytem or custom handler itself, accepts "slovak" characters or better say characters in encoding "utf -8"?

    handler and utf-8

    snippet of code from java client:

    //

    String rawString = "ľščťžýáíéúä";
    byte[] bytes = rawString.getBytes(StandardCharsets.UTF_8);
    String utf8EncodedString = new String(bytes, StandardCharsets.UTF_8);

    String jsonHnadler = new StringBuilder()
    .append("{")
    .append("\"objectId\":\"customDiakritikaID\",")
    .append("\"eventId\":\"customDiakritikaEvent\"")
    .append("\"data\":[\"key1:"+utf8EncodedString+"\"]")
    .append("}").toString();

    ...

    HttpRequest requestHandler = HttpRequest.newBuilder()
    .POST(HttpRequest.BodyPublishers.ofString(jsonHnadler))
    .uri(URI.create("http://192.168.50.105:8018/icws/"+sessionId+"/system/handler-notification"))
    //.setHeader("User-Agent", "Java 11 HttpClient Bot") // add request header
    .header("Cookie", hc.toString())
    .header("Accept","*/*")
    .header("Accept-Language","en-us")
    //.header("Content-Type", "application/vnd.inin.icws+JSON")
    .header("Content-Type", "application/json;charset=utf-8")
    .header("ININ-ICWS-CSRF-Token",csfrToken)
    .build();

    //

    Sorry for english (-:

    Thank you for advice and help

    Best regards

    Pavel


    #Handlers

    ------------------------------
    Pavel Broska
    Alcasys Slovakia a.s
    ------------------------------



  • 2.  RE: handler does not accepts characters in utf-8 encoding

    Posted 12-19-2020 12:47

    Hey, I had the same issue with my language,  and the problem is a lack of support for unicode characters.

    They have fixed the issue in 2020 R3.

    See SRC IC-158140

    Best regards,



    ------------------------------
    Egill Palsson
    Advania Sverige AB
    ------------------------------



  • 3.  RE: handler does not accepts characters in utf-8 encoding

    Posted 04-29-2021 09:41
    Hello guys,
    I have the same issue for Greek characters, I'm already on 202r3.
    Do you know if the fix involved also this characters set?
    Thanks!
    davide

    ------------------------------
    Davide Graziani
    Arval Service Lease
    ------------------------------



  • 4.  RE: handler does not accepts characters in utf-8 encoding

    Posted 04-29-2021 10:53
    I am not using any Greek characters in my system, but as of 2020R3 this fixed the problems with my language (Icelandic).

    But this only applies to the exact scenario listed, that is if you are trying to pass date using Handler notification?  They say that it is UNICODE support, and as such, if it is supported in UNICODE it should be working.

    Also, worth checking, when you upgraded to 2020R3, did you also publish some of your older Custom Handlers?  You might have to re-create some of them using any new toolsteps that might have been replaced and are relevant.  You can just test this out by creating a simple handlers based on the new tools available, and try passing the failing characters.

    Good luck :)

    ------------------------------
    Egill Palsson
    Advania Sverige AB
    ------------------------------



  • 5.  RE: handler does not accepts characters in utf-8 encoding

    Posted 04-29-2021 11:03
    Hello Egill,
    thank you for your quick replay. What I'm trying to achieve is getting data from an Oracle DB and store in a Custom parameter.
    It works for all countries I have...but not Greece....instead of the correct greek characters I receive "????".
    I'll try to recreate the handler.
    Thank you again.
    Davide

    ------------------------------
    Davide Graziani
    Arval Service Lease
    ------------------------------



  • 6.  RE: handler does not accepts characters in utf-8 encoding

    Posted 04-29-2021 14:13
    Ok just spitballing here, 

    But could this be solved my manipulating the Oracle Query to format what it receives as UNICODE?

    Sorry it this sounds stupid, I am not a big DB guy, but I know sometimes when getting data it might need to be formatted when collected.

    Anyway, feel free to send me some of the characters that are misbehaving and I can test running them through my Dev system. 


    ------------------------------
    Egill Palsson
    Advania Sverige AB
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources