'不可转换字符'在发送包含特殊字符的httprequestheader时,httprequest节点的例外

发布于 2025-01-25 22:53:55 字数 2232 浏览 4 评论 0原文

当将httprequestheader发送到包含特殊字符的httprequest节点时,我会得到一个“不可逆转的字符”例外。

调试时的异常列表中的错误:

RecoverableException
    File:CHARACTER:/jenkins/slot0/product-build/WMB/src/CommonServices/ImbConverter.cpp
    Line:INTEGER:733
    Function:CHARACTER:ImbConverterCPP::    
    Type:CHARACTER:
    Name:CHARACTER:
    Label:CHARACTER:
    Catalog:CHARACTER:BIPmsgs
    Severity:INTEGER:3
    Number:INTEGER:2136
    Text:CHARACTER:Unconvertable character
    Insert
            Type:INTEGER:5
            Text:CHARACTER:1920
    Insert
            Type:INTEGER:5
            Text:CHARACTER:4c0061006c0069006100192073002000420075007200690061006c002000460075006e006400200061006e006400200043006100720065002000450078007000 ...data truncated to first 64 chars
    Insert
            Type:INTEGER:2
            Text:CHARACTER:819

我的eSQL代码的摘要:

SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/octet-stream';
SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = rInputDocData.*:DocumentName;
--Setting the content
SET OutputRoot.BLOB.BLOB = BASE64DECODE(rInputDocAttachment.*:AttachmentData64Binary);

特殊字符在rinputdocdata字段中。*:documentname。其中一些值是:

Printing….PDF
Mark’s Agreement .pdf

在上述两个值中注意……和'未被识别为UTF-8的一部分。

是否有一种方法可以将这些值转换为ESQL中的ISO 8859-1,因为在记事本++中进行相同的转换会导致被接受的值?

我已经尝试了以下步骤,但没有任何效果,但仍遇到相同的错误:

  1. 设置outputRoot.properties.codedcharetid to 1208 and outputroot.properties.properties.sodoperties.sove to 546,因为属性是在输入中收到的请求时的属性。 。

  2. 设置outputroot.properties.codedcharetid to 819。

  3. 。 charset = utf-8'。

  4. 将Content-type HttpRequestHeader设置为'application/Octet-stream; charset = ISO-8859-1'。

  5. 在以下方式中施放httprequestheader'x-integrationser-resource-name'

    1. set outputRoot.httprequestheader。“ x-integrationer-resource-name” = cast(rinputdocdata。
    2. 设置outputRoot.httprequestheader。“ x-integrationer-resource-name” = cast(rinputdocdata。
    3. set outputRoot.httprequestheader。“ x-integrationer-resource-name” = cast(cast(cast(rinputdocdocdata。

源供应商拒绝处理/转换特殊字符,因此我们可以在ACE中处理此特殊字符。任何帮助都将不胜感激。

I'm getting an 'Unconvertable character' exception when sending a HTTPRequestHeader to HTTPRequest Node containing a special character.

Error in the ExceptionList when debugging:

RecoverableException
    File:CHARACTER:/jenkins/slot0/product-build/WMB/src/CommonServices/ImbConverter.cpp
    Line:INTEGER:733
    Function:CHARACTER:ImbConverterCPP::    
    Type:CHARACTER:
    Name:CHARACTER:
    Label:CHARACTER:
    Catalog:CHARACTER:BIPmsgs
    Severity:INTEGER:3
    Number:INTEGER:2136
    Text:CHARACTER:Unconvertable character
    Insert
            Type:INTEGER:5
            Text:CHARACTER:1920
    Insert
            Type:INTEGER:5
            Text:CHARACTER:4c0061006c0069006100192073002000420075007200690061006c002000460075006e006400200061006e006400200043006100720065002000450078007000 ...data truncated to first 64 chars
    Insert
            Type:INTEGER:2
            Text:CHARACTER:819

Snippet of my esql code:

SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/octet-stream';
SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = rInputDocData.*:DocumentName;
--Setting the content
SET OutputRoot.BLOB.BLOB = BASE64DECODE(rInputDocAttachment.*:AttachmentData64Binary);

The special character is coming in the field rInputDocData.*:DocumentName. Some of the values are:

Printing….PDF
Mark’s Agreement .pdf

Notice the … and ’ in the above two values which are not recognized as part of UTF-8.

Is there a way to convert these values to ISO 8859-1 in ESQL as doing the same conversion in Notepad++ leads to the values getting accepted?

I have tried the below steps but none have worked and I'm still getting the same error:

  1. Setting OutputRoot.Properties.CodedCharSetId to 1208 and OutputRoot.Properties.Encoding to 546 as the properties were when the request was received in Input.

  2. Setting OutputRoot.Properties.CodedCharSetId to 819.

  3. Setting Content-Type HTTPRequestHeader to 'application/octet-stream; charset=utf-8'.

  4. Setting Content-Type HTTPRequestHeader to 'application/octet-stream; charset=iso-8859-1'.

  5. Casting the HTTPRequestHeader 'X-IntegrationServer-Resource-Name' in the below ways:

    1. SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(rInputDocData.*:DocumentName AS CHARACTER CCSID 1208 ENCODING 546);
    2. SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(rInputDocData.*:DocumentName AS CHARACTER CCSID 819);
    3. SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(CAST(rInputDocData.*:DocumentName AS CHARACTER CCSID 1208 ENCODING 546) AS CHARACTER CCSID 819);

The source vendor have refused to handle/convert the special character so it is upon us to handle this in ACE. Any help would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

星星的軌跡 2025-02-01 22:53:56

HTTP标头应仅使用US-ASCII范围内的字符。可以容忍其他一些字符可以容忍,但是Web服务器实现在此领域不一致。

有关更多详细信息,请参见此处的讨论:在http header值中允许哪些字符?
该对话的参与者之一是HTTP/1.1规范的作者,因此我认为我们可以依靠他的意见。

关于:

请注意…和'在上述两个值中,这些值未被识别为UTF-8的一部分。

UTF-8可以代表任何任何 unicode字符,因此该语句不可能是正确的。如果您仔细查看错误,则引用的CCSID为819,是ISO-8859-1的IBM CCSID。

HTTP headers should only use characters in the US-ASCII range. Some other characters may be tolerated, but web server implementations are not consistent in this area.

See the discussions here for more details: what characters are allowed in HTTP header values?
One of the participants in that conversation is an author of the HTTP/1.1 specification, so I think we can rely on his input.

re:

Notice the … and ’ in the above two values which are not recognized as part of UTF-8.

UTF-8 can represent any Unicode character, so that statement cannot be true. If you look carefully at the error, the quoted CCSID is 819, which is the IBM CCSID for ISO-8859-1.

苍白女子 2025-02-01 22:53:56

似乎...角色不在CCSID 819 Charset中。它在Latin 1,CCSID 1252的Windows版本中,但是正如上一份答案所说,可能与目标Web服务器不起作用。

您可以尝试这些,但不确定是否有效:

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(ASBITSTREAM(rInputDocData.*:DocumentName CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 819);

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(ASBITSTREAM(rInputDocData.*:DocumentName CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 1252);

It seems that the ... character is just not in the CCSID 819 charset. It's in the Windows version of Latin 1, CCSID 1252, but as the previous answer said, that may not work with the target Web server.

You can try these, but not sure any will work:

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(ASBITSTREAM(rInputDocData.*:DocumentName CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 819);

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(ASBITSTREAM(rInputDocData.*:DocumentName CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 1252);
め可乐爱微笑 2025-02-01 22:53:56

以下对我有用,但是正如最高评论所指出的那样,它确实会在目标服务器中的编码错误中失败:

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(CAST(rInputDocData.*:DocumentName AS BLOB CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 819);

The below worked for me, but as the top comment had pointed out, it did go on to fail with an encoding error in the target server:

SET OutputRoot.HTTPRequestHeader."X-IntegrationServer-Resource-Name" = CAST(CAST(rInputDocData.*:DocumentName AS BLOB CCSID InputRoot.Properties.CodedCharSetId) AS CHARACTER CCSID 819);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文