git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] http: don't send C or POSIX in Accept-Language

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Jul 11, 2025, 20:57 UTC
Message-ID
<idgdx2au3zgpowozspvu6ttvehybtwwuqf5kwqga4yok7uo2uj@wno7evyjg6pq>
In-Reply-To
<875xfypsom.fsf@gmail.com>
On Fri, Jul 11, 2025 at 10:02:01AM -0800, Collin Funk wrote:
Show 18 quoted lines
> Justin Tobler <jltobler@gmail.com> writes:
> 
> > From my understanding, each language is expected to be defined in the
> > following form:
> >
> >   language[_territory][.codeset][@modifier]
> >
> > When we parse the list of languages we only care about the
> > `language[_territory]` part though.
> >
> > From looking at ISO 639 language codes, only codes with two or three
> > characters are valid. If we wanted to be a bit more strict, we could
> > check the length of the language code (everything before the first '_')
> > and filter out anything outside of those limits. This would naturally
> > filter out "C" and "POSIX" without having to mention them explicitly.
> 
> Filtering out anything that isn't 2-3 letters seems like a good
> heuristic to me.

except that it would be incorrect, as language tags are defined in RFC5646 and are larger than that.

most importantly, deriving language tags from locales provides some very useful tags when including the characters after the _, because zh_CN and zh_HK use completely different scripts, for example.

Carlo
Previous: Collin FunkNext: brian m. carlson
Message 7 of 18 in “Filter C and POSIX out of Accept-Language”
  1. 0/1 Filter C and POSIX out of Accept-Languagebrian m. carlson, Jul 10, 2025
  2. 1/1 http: don't send C or POSIX in Accept-Languagebrian m. carlson, Jul 10, 2025
  3. Junio C HamanoJul 10, 2025
  4. brian m. carlsonJul 10, 2025
  5. Justin ToblerJul 11, 2025
  6. Collin FunkJul 11, 2025
  7. Carlo Marcelo Arenas BelónJul 11, 2025
  8. brian m. carlsonJul 11, 2025
  9. Carlo ArenasJul 11, 2025
  10. Collin FunkJul 11, 2025
  11. Junio C HamanoJul 11, 2025
  12. Carlo Marcelo Arenas BelónJul 11, 2025
  13. Eli SchwartzJul 15, 2025
  14. Junio C HamanoJul 10, 2025
  15. brian m. carlsonJul 10, 2025
  16. Collin FunkJul 10, 2025
  17. Han YoungJul 11, 2025
  18. Junio C HamanoJul 11, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.