Web API not supporting Swedish character filename

Hi All,

In Web API, when Appian receives file in binary format, we are using Appian-Document-Name field in the header to pass file name. And it is working fine when for English characters but when comes to Swedish file names it gives random some values in the file name. 

For Example, Expected file name ÖPPNA.pdf, actual output cames ?PPNA.pdf

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Now I understood, you are referring to Appian-Document-Name header where we are passing file name it should to be encode with UTF-8 then Appian will detect properly. Am I correct?

  • Thanks for the quick solution. One question, to test this scenario tried to pass encoded file name using Appian function htmlencode() and urlencode(), for both option it sent to appian in encoded way and stored in database but decode not happened automatically. Whether we have write decode function while storing in DB?

  • 0
    Certified Lead Developer
    in reply to shantanub0980

    Not sure what you mean. URL encoding is something completely different than charset encoding. A quick AI generated explanation:

    Charset Encoding vs URL Encoding: A Key Difference

    In the world of web development, two important concepts are often confused with each other: charset encoding and URL encoding. While both deal with text data, they serve distinct purposes.

    1. Charset Encoding (Character Set)

    Purpose: Define how characters in a document or message should be interpreted by the recipient's system.

    Example Use Case: When sending an email from one mail client to another across different systems and languages, charset encoding ensures that special characters like accents are correctly displayed on both ends.

    Common Charset Encodings:

    • UTF-8 (most widely used)
    • ISO 8859-1 (Latin-1)
    • Windows-1252

    In HTML documents, the meta tag is often used to specify the character set:

    <meta charset="UTF-8">

    2. URL Encoding (Query String)

    Purpose: Convert special characters in a query string into safe bytes that can be transmitted over HTTP.

    Example Use Case: When sending data from an HTML form or API request, URL encoding ensures that spaces and other non-alphanumeric characters are properly encoded so they don't interfere with the transmission process.

    Common URL Encodings:

    • application/x-www-form-urlencoded (default for web forms)
    • JSON (JavaScript Object Notation)

    In URLs, special characters like spaces (%20) or ampersands (&) need to be replaced:

    GET /path/to/resource?param1=value&param2=another+value HTTP/1.1

    Key differences:

    • Charset encoding: defines how text data is interpreted by the recipient's system.
    • URL encoding: converts special characters in a query string into safe bytes for transmission over HTTP.

    In summary, charset encoding ensures correct interpretation of text data across different systems and languages, while URL encoding ensures that special characters are properly encoded when sending data via URLs.

  •  When I passed value in header in charset encoded format it is working fine. Thanks for the support