💾 Archived View for mozz.us › files › rfc_gemini_favicon.gmi captured on 2022-03-01 at 15:09:16. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

➡️ Next capture (2022-04-27)

-=-=-=-=-=-=-

RFC: Adding Emoji Favicons to Gemini

From: Michael Lazar (lazar.michael22@gmail.com)

Date: Wednesday, 3 June 2020

Updated: Tuesday, 26 Feb 2021 (Added motivation)

Status: DRAFT

1. Introduction

1.1 Motivation

To spread a bit of joy around geminispace.

1.2. Emoji

Emojis are an official part of the unicode standard and are widely used in modern communication.

As of the Unicode Standard, Version 13.0.0, there are 3,304 emoji characters in total [1].

Compared to web favicons which primarily use image formats, they are:

[1] https://unicode.org/emoji/charts/emoji-counts.html

2. Usage

This RFC defines a "server" as the domain[:port] component of a gemini URL. This is typically the same as the server host, but may be different in the case of gemini proxy requests. URLs with subdomains are treated as separate servers, even though they may resolve to the same IP address. For example, "gemini://foo.example.com" and "gemini://example.com" are to be considered distinct servers with distinct favicon files.

Gemini servers MAY expose a favicon resource. If exposed, the favicon MUST reside in the root of the server directory under the path "/favicon.txt". A gemini request to this resource MUST return a standard gemini response with code "20" and a mime type of "text/plain". The response MAY include a charset and other extra meta components, as defined in the gemini protocol.

Gemini clients MAY request the favicon resource from a gemini server. A gemini client MUST NOT treat the absence of a favicon as an error. If a server does not expose a favicon, the client might handle this by leaving the area where the favicon would usually be displayed blank, or by using a "placeholder" favicon.

Gemini clients MUST cache the response from a favicon request for at least one hour, or the duration that the application is running, whichever is shorter. This is intended to reduce unnecessary server load by limiting repeated requests to the same resource.

Interactive gemini clients SHALL NOT request the favicon until the user has clicked on a URL corresponding to that server. In other words, a client cannot attempt to pre-fetch the favicon resource before the user has actively navigated to the page.

3. Favicon Document Format

The format for a favicon document {F} is defined as follows. Brackets [] indicate optional elements:

{F} ::= {E}[{C}]

{E} ::= emoji

{C} ::= [<CR>]<LF>

An emoji is a single unicode character or character sequence as defined by the Unicode Consortium [2][3]. This includes sequences using modifiers such as skin tones, when they are applied to other emoji characters.

[2] http://www.unicode.org/emoji/charts/full-emoji-list.html

[3] https://www.unicode.org/emoji/charts/full-emoji-modifiers.html

The document may optionally end in a newline {C}. This is intended to make it easier to author favicon documents, since many text editors will automatically insert a newline at the end of a file. The newline does not contain any semantic meaning and MUST be removed by the client before rendering the favicon.

Gemini clients SHALL NOT render any favicon that does not conform to the specified format. This includes non-emoji unicode characters, and strings of multiple emoji characters that are not used as modifiers.

4. Examples

4.1 A server provides a favicon

1. The user attempts to load a gemini URL.

gemini://gemini.example.com/files/about.txt

2. The gemini client first checks for a favicon by sending a separate request to the server.

gemini://gemini.example.com/favicon.txt

3. The server responds with a successful status and the emoji character for "eggplant".

20 text/plain
🍆

4. The client caches the favicon response for the "gemini.example.com" domain.

5. The client loads the initial URL and displays the favicon on the page.

4.2 A server does not provide a favicon

1. The user attempts to load a gemini URL.

gemini://gemini.example.com/files/about.txt

2. The gemini client first checks for a favicon by sending a separate request to the server.

gemini://gemini.example.com/favicon.txt

3. The server responds with an error status.

51 The requested resource was not found

4. The client caches response indicating that the domain "gemini.example.com" does not contain a favicon.

5. The client loads the initial URL and displays the page without a favicon.