~adnano/go-gemini-devel

2 2

BOM issue

Details
Message ID
<CFDQEAQXERD1.1Z6CZHQ28MDQS@localhost>
DKIM signature
pass
Download raw message
Hi adnano --

I finally realized the solution to a bug I encountered a long time ago.
In some cases, the first line was not parsed properly as Gemini:

https://alex.flounder.online/test/bom.gmi

The issue is a byte order mark at the beginning of the line. I think
something like this https://gist.github.com/jaypozo/eaf13f7ecfec68b408cf
would help -- let me know if you'd like me to submit a patch

All the best,
Alex
Details
Message ID
<CFGDP6MNNAPA.1EKEEKZQ85859@nitro>
In-Reply-To
<CFDQEAQXERD1.1Z6CZHQ28MDQS@localhost> (view parent)
DKIM signature
pass
Download raw message
On Sun Oct 31, 2021 at 12:26 PM EDT, alex wennerberg wrote:
> I finally realized the solution to a bug I encountered a long time ago.
> In some cases, the first line was not parsed properly as Gemini:
>
> https://alex.flounder.online/test/bom.gmi
>
> The issue is a byte order mark at the beginning of the line. I think
> something like this https://gist.github.com/jaypozo/eaf13f7ecfec68b408cf
> would help -- let me know if you'd like me to submit a patch

This was previously discussed on Gitlab[1].

Personally, I'm of the opinion that servers should not be sending a BOM
for UTF-8 text: this information is provided by the media type sent in
the server response. Also, I don't think this belongs in go-gemini's
parsing functions as it is specific to UTF-8 text while the parsing
functions can (in theory) work with other encodings.

[1]: https://gitlab.com/gemini-specification/protocol/-/issues/36
Details
Message ID
<371D3D2B-EBCC-4758-AAB8-F72CD01041F6@alexwennerberg.com>
In-Reply-To
<CFGDP6MNNAPA.1EKEEKZQ85859@nitro> (view parent)
DKIM signature
pass
Download raw message
Hmm interesting. I think I could strip it on the server level for flounder.online then. Thanks for the info

Alex

> On Nov 3, 2021, at 12:12 PM, Adnan Maolood <me@adnano.co> wrote:
> 
> On Sun Oct 31, 2021 at 12:26 PM EDT, alex wennerberg wrote:
>> I finally realized the solution to a bug I encountered a long time ago.
>> In some cases, the first line was not parsed properly as Gemini:
>> 
>> https://alex.flounder.online/test/bom.gmi
>> 
>> The issue is a byte order mark at the beginning of the line. I think
>> something like this https://gist.github.com/jaypozo/eaf13f7ecfec68b408cf
>> would help -- let me know if you'd like me to submit a patch
> 
> This was previously discussed on Gitlab[1].
> 
> Personally, I'm of the opinion that servers should not be sending a BOM
> for UTF-8 text: this information is provided by the media type sent in
> the server response. Also, I don't think this belongs in go-gemini's
> parsing functions as it is specific to UTF-8 text while the parsing
> functions can (in theory) work with other encodings.
> 
> [1]: https://gitlab.com/gemini-specification/protocol/-/issues/36
Reply to thread Export thread (mbox)