bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] [bug #55609] Add support for BOM exceptions as indica


From: Bruno Haible
Subject: [bug-gnu-libiconv] [bug #55609] Add support for BOM exceptions as indicated in RFC 2781 section 3.3
Date: Sun, 27 Jun 2021 10:55:55 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Follow-up Comment #9, bug #55609 (project libiconv):

> A simple example using a "digital signature data application" DSDA.

OK, let's talk about this particular example.

> This DSDA is the recipient of UTF-16, UTF-16BE, or UTF-16LE data. It follows
the RFC and so does its providers. When data comes in labeled it calls iconv
to convert it to UTF-16. ... But there is a big problem, iconv cannot support
this application because it cannot write the UTF-16 data in Little Endian
format as an unlabeled UTF-16 file

If you are implementing such a DSDA:

If you want a DSDA that takes labeled input and computes a signature based on
a UTF-16 little endian without BOM stream, you can just call
iconv_open("UTF-16LE", encoding_from_label). That is, produce UTF-16 little
endian without BOM as the intermediate representation.

If you are invoking / interfacing to such a DSDA:

Use iconv_open("UTF-16", ...), and use "UTF-16" as the label. This will ensure
that a BOM is present, and it will resolve ambiguities.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55609>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]