跳到主内容

搜索

搜索

Document Labelled Utf-16 But Has Utf-8 Content

评论

4 条评论

  • Avatar
    Domingo Rodriguez
    版主

    Are you saying that although you define "UTF-16" as the encoding for the BarTender XML Script command response, the format we use seems to be in "UTF-8" encoding?

     

    When you say "my parser", is that from your ERP system? Are you using SAP? Please give as much details on your ERP system as you can please.

    0
  • Avatar
    Legacy Poster

    I had the same issue.  The response certainly does not LOOK like utf-16 either.

     

    My application is in python and the python XML parser (etree) was complaining about this.

    Since python offers a simple conversion between encodings, I tried converting it.

     

    response = response.encode('utf16')

     

    Now the xml tag coming back from BarTender/Commander matches the actual encoding, so the parser accepts it.

     

    It's definitely a bit of a shady solution, I don't love doing this.  But it works :)

     

    -Ben Mehlman

    0
  • Avatar
    Legacy Poster

    Are you saying that although you define "UTF-16" as the encoding for the BarTender XML Script command response, the format we use seems to be in "UTF-8" encoding?

     

    When you say "my parser", is that from your ERP system? Are you using SAP? Please give as much details on your ERP system as you can please.

     

    Hi Domingo, I'm currently working with your phone support on this issue.. as it has popped up again.

     

    It is the opposite of what you said.  When the Commander BTXML response encoding is set to UTF-8, it sends the response as UTF-8, but with an encoding=utf-16 in the header.  The encoding is right, but the header is wrong.  It's definitely a Commander or Bartender problem.

     

    By setting the response encoding dropdown to UTF-16, it works.. the response is encoded as UTF-16, and the header says utf-16.. it matches therefore everything works.  However we need to use utf-8.

    0
  • Avatar
    Domingo Rodriguez
    版主

    Do you have the CAS number for the ticket you opened?

     

    Can you include here the exact BTXML-Script you're using for setting the XML Response in UTF-8 format?

     

    Will you continue with this issue over the phone with our tech-support department, or over the forum?

    0

请先登录再写评论。