FAQ
Hello,

I encountered an issue while parsing some third party XML files, which
declare the encoding "Utf-8". This encoding is not recognized by the
encoding/xml library.
The fact is that the standard library is looking for either "", "utf-8" or
"UTF-8" (here is the code
<https://github.com/golang/go/blob/9c04d00214cb836ddcf4b7b6b0c4b4e5c11bb957/src/encoding/xml/xml.go#L583>
).

Would you say it is a bug? Should not this test be case insensitive (since
it already accepts both upper and down case strings)?
Indeed, this XML specification <http://www.w3.org/TR/2008/REC-xml-20081126/>
explains that "XML processors should match character encoding names in a
case-insensitive way". I understand that "should" does not make this
mandatory but would not it be better?

Thanks,

Guillaume.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Aug 31, 2015 at 3:30 pm

    On Mon, Aug 31, 2015 at 1:43 AM, wrote:
    I encountered an issue while parsing some third party XML files, which
    declare the encoding "Utf-8". This encoding is not recognized by the
    encoding/xml library.
    The fact is that the standard library is looking for either "", "utf-8" or
    "UTF-8" (here is the code).

    Would you say it is a bug? Should not this test be case insensitive (since
    it already accepts both upper and down case strings)?
    Indeed, this XML specification explains that "XML processors should match
    character encoding names in a case-insensitive way". I understand that
    "should" does not make this mandatory but would not it be better?
    I'm no expert, but it sounds like a bug to me. Please open an issue
    at https:/golang.org/issue . Thanks.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Giulio Iotti at Aug 31, 2015 at 4:00 pm

    On Monday, August 31, 2015 at 6:30:19 PM UTC+3, Ian Lance Taylor wrote:
    On Mon, Aug 31, 2015 at 1:43 AM, <gchar...@tea-ebook.com <javascript:>>
    wrote:
    I'm no expert, but it sounds like a bug to me. Please open an issue
    at https:/golang.org/issue . Thanks.

    And I probably introduced it :) I'll post another CL.

    --
    Giulio Iotti
    https://twitter.com/dullboy

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Gcharmetant at Aug 31, 2015 at 7:23 pm
    I filed an issue on GitHub <https://github.com/golang/go/issues/12417>.

    Thank you for your feedback, Ian and Giulio.

    Le lundi 31 août 2015 18:00:00 UTC+2, Giulio Iotti a écrit :
    On Monday, August 31, 2015 at 6:30:19 PM UTC+3, Ian Lance Taylor wrote:

    On Mon, Aug 31, 2015 at 1:43 AM, wrote:
    I'm no expert, but it sounds like a bug to me. Please open an issue
    at https:/golang.org/issue . Thanks.

    And I probably introduced it :) I'll post another CL.

    --
    Giulio Iotti
    https://twitter.com/dullboy
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 31, '15 at 2:59p
activeAug 31, '15 at 7:23p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase