Authentication-Results: mail-b.sr.ht; dkim=pass header.d=adnano.co header.i=@adnano.co Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by mail-b.sr.ht (Postfix) with ESMTPS id 209CB11EF0E for <~adnano/go-gemini-devel@lists.sr.ht>; Wed, 3 Nov 2021 19:12:11 +0000 (UTC) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adnano.co; s=key1; t=1635966726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=QRrysVgExHxg2oKFN1Z8AKxv8M9HKhxKR1kZhYPW9/c=; b=i+ATMfGKCmAcqjOVpfAiqI/DhddwVk963KYB/wVYeAgLyZvnEf2VvJoKb/3MD6NpiJgq27 F7g+ORwBuHy/tnPEeIQSEie2Yw1QYQ5YmPRUlA++BCkzzqLCGiZ1YvZKyxcBhcp9Su6Bk2 j25QSUb+Lyk+t3CaWVuZvx1gsIFp1G0mSMisxwisKpAWlIcGi6Lx/5tko3tQwKa3Lgftun 3sEbGXIdwQpLWECs1+UlF40krOp54KfXanpPqU3ndlTkSRtkpjk2cLOA23dQSYITuSRm/i q0NH6lq5dAjqLMFsWXM9ZqarJjhCsw/cZCsF7k505XbeHqdX8Gz0QSOjBxjF2Q== Content-Type: text/plain; charset=UTF-8 Subject: Re: BOM issue X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Adnan Maolood" To: "alex wennerberg" , <~adnano/go-gemini-devel@lists.sr.ht> Date: Wed, 03 Nov 2021 15:07:09 -0400 Message-Id: In-Reply-To: Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: me@adnano.co 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