TIL:Punycode - 域名中的 Unicode Dark _ □ ✕
  • Posts
  • About
  • Debug
Post

TIL:Punycode - 域名中的 Unicode

Published
2026-09-01 10:30 UTC (precision: second)
Source feed
Taxodium [exclude this blog]
Link
https://taxodium.ink/til-punycode.html
Length
2520 runes
Extracted text
TIL:Punycode 域名中的 Unicode 之前看了 マリウス 的 disable-javascript.org,我就用 Elfeed 訂閱了他的博客,但後面一直在 Elfeed 裡看到拉取报錯,錯誤信息如下: [error]: https://マリウス.com/index.xml: "(60) Peer certificate cannot be authenticated with known CA certificates." Elfeed 是用 curl 發請求的(前提是 elfeed-use-curl 為 t),直接用 curl 請求的話,报錯是: curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to マリウス.com:443 之後我去問了 Kagi Assistant,經過一些排查後,終於找到了問題。 留意請求的域名,你會發現 你会讶异,你是我最压抑,最深处的秘密 ,我請求的域名是 マリウス.com 。但是 域名只支持 ASCII ,而 マリウス 顯然不是 ASCII ,而是 Unicode。 當你在瀏覧器中輸入域名包含 非 ASCII 字符時,瀏覧器會將其轉成 Punycode 1表示: Punycode 是 Unicode 在受限的 ASCII 字元子集下,用於網際網路主機名稱的表示方式。使用 Punycode 時,包含 Unicode 字元的主機名稱會被轉換為僅由字母、數字與連字號組成的 ASCII 子集,稱為字母‑數字‑連字號(letter–digit–hyphen, LDH)子集。 例如, マリウス.com 會被編碼為 xn--gckvb8fzb.com ,其中的 gckvb8fzb 是 マリウス 對應的 Punycode,xn-- 是一個固定的 國際化域名 (International Domain Names, IDN) 前綴。 檢查我現在的 curl (curl -V),看到的是: curl 8.7.1 (x86_64-apple-darwin25.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.68.1 Release-Date: 2024-03-27 Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets 裡面沒有 IDN 相關的功能,所以是無法处理 マリウス.com 這樣的 IDN 的。 知道問題就好辦了,讓 curl 支持 IDN 就好,我用 homebrew 下載了新的 curl: # 先安裝新版本 brew update brew install curl # 設到 PATH 的前面,优先用 homebrew 的版本 export PATH="$(brew --prefix)/opt/curl/bin:$PATH" 裡面就包含 IDN: curl 8.21.0 (aarch64-apple-darwin25.4.0) libcurl/8.21.0 OpenSSL/3.6.4 zlib/1.2.12 brotli/1.2.0 zstd/1.5.7 AppleIDN libpsl/0.23.3 libssh2/1.11.1 nghttp2/1.70.0 ngtcp2/1.25.0 nghttp3/1.18.0 mit-krb5/1.7-prerelease OpenLDAP/2.4.28/Apple Release-Date: 2026-06-24 Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt mqtts pop3 pop3s rtsp scp sftp smtp smtps telnet tftp ws wss Features: alt-svc AppleSecTrust AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd 用這個版本的 curl 進行請求,就能正常返回了。 如果 curl 不支持 IDN 也不想更新,用 Ponycode 形式的域名 (xn–gckvb8fzb.com) 就好。 另外 マリウス 也寫了篇文章解釋他的域名,感興趣也可以看看: NEVER click on a link that looks like that。 脚注: 1 相關規𫈣: RFC 5891 - Internationalized Domain Names in Applications (IDNA): Protocol RFC 3492 - Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA) 感谢你的阅读! 欢迎 邮件 跟我分享你的想法 :) 你也可以 訂閱 我的博客,保持更新 :P 祝好,素未某面的读者。 純文本版本 原始 org 文件
Stored topics

Every stored assignment is listed, including rows below the current cutoff (0.75), so a missing tag can be explained.

Concept Code Score Meter Margin Origin Path
economy, business and finance economy-business-and-finance 0.98 3.87 ↑derived from 20000225 economy, business and finance
products and services products-and-services 0.98 3.87 ↑derived from 20000225 economy, business and finance > products and services
computing and information technology computing-and-information-technology 0.98 3.87 direct economy, business and finance > products and services > computing and information technology
science and technology science-and-technology 0.98 3.67 direct science and technology
technology and engineering technology-and-engineering 0.97 3.32 direct science and technology > technology and engineering
software and applications software-and-applications 0.96 3.08 direct economy, business and finance > products and services > computing and information technology > software and applications
information technology and computer science information-technology-and-computer 0.96 3.07 direct science and technology > technology and engineering > information technology and computer science
Open source open-source 0.89 2.05 direct economy, business and finance > products and services > computing and information technology > software and applications > Open source
Information security information-security 0.86 1.81 direct science and technology > technology and engineering > information technology and computer science > Information security
Software development software-development 0.86 1.80 direct economy, business and finance > products and services > computing and information technology > software and applications > Software development
Cryptography cryptography 0.78 1.27 direct science and technology > technology and engineering > information technology and computer science > Cryptography
society society 0.53 0.12 ↑derived from 20001300 society
fundamental rights fundamental-rights 0.53 0.12 ↑derived from 20001300 society > fundamental rights
privacy privacy 0.53 0.12 direct society > fundamental rights > privacy
crime, law and justice crime-law-and-justice 0.48 -0.08 ↑derived from 20000086 crime, law and justice
crime crime 0.48 -0.08 ↑derived from 20000086 crime, law and justice > crime
cyber crime cyber-crime 0.48 -0.08 direct crime, law and justice > crime > cyber crime
artificial intelligence artificial-intelligence 0.37 -0.55 direct science and technology > technology and engineering > information technology and computer science > artificial intelligence
arts, culture, entertainment and media arts-culture-entertainment-and-media 0.32 -0.77 ↑derived from 20000013 arts, culture, entertainment and media
arts and entertainment arts-and-entertainment 0.32 -0.77 ↑derived from 20000013 arts, culture, entertainment and media > arts and entertainment
literature literature 0.32 -0.77 direct arts, culture, entertainment and media > arts and entertainment > literature
scientific research scientific-research 0.23 -1.19 ↑derived from 20000739 science and technology > scientific research
scientific exploration scientific-exploration 0.23 -1.19 ↑derived from 20000739 science and technology > scientific research > scientific exploration
space exploration space-exploration 0.23 -1.19 direct science and technology > scientific research > scientific exploration > space exploration
media and entertainment industry media-and-entertainment-industry 0.19 -1.43 ↑derived from 20000306 economy, business and finance > products and services > media and entertainment industry
books and publishing books-and-publishing 0.19 -1.43 direct economy, business and finance > products and services > media and entertainment industry > books and publishing
Self-hosting self-hosting 0.18 -1.49 direct economy, business and finance > products and services > computing and information technology > Self-hosting
streaming service streaming-service 0.16 -1.62 direct economy, business and finance > products and services > media and entertainment industry > streaming service
culture culture 0.14 -1.78 direct arts, culture, entertainment and media > culture
lifestyle and leisure lifestyle-and-leisure 0.09 -2.35 ↑derived from local:mmorpg lifestyle and leisure
leisure leisure 0.09 -2.35 ↑derived from local:mmorpg lifestyle and leisure > leisure
game game 0.09 -2.35 ↑derived from local:mmorpg lifestyle and leisure > leisure > game
video game video-game 0.09 -2.35 ↑derived from local:mmorpg lifestyle and leisure > leisure > game > video game
MMORPG mmorpg 0.09 -2.35 direct lifestyle and leisure > leisure > game > video game > MMORPG
environment environment 0.07 -2.61 direct environment
hobby hobby 0.06 -2.68 direct lifestyle and leisure > leisure > hobby
animation animation 0.06 -2.70 direct arts, culture, entertainment and media > arts and entertainment > animation
labour labour 0.06 -2.73 direct labour
podcast podcast 0.06 -2.74 direct economy, business and finance > products and services > media and entertainment industry > podcast
film industry film-industry 0.06 -2.75 direct economy, business and finance > products and services > media and entertainment industry > film industry
education education 0.05 -2.86 direct education
mass media mass-media 0.05 -2.88 ↑derived from local:blogging arts, culture, entertainment and media > mass media
social media social-media 0.05 -2.88 ↑derived from local:blogging arts, culture, entertainment and media > mass media > social media
Blogging blogging 0.05 -2.88 direct arts, culture, entertainment and media > mass media > social media > Blogging
sport sport 0.04 -3.13 ↑derived from 20001183 sport
competition discipline competition-discipline 0.04 -3.13 ↑derived from 20001183 sport > competition discipline
eSports esports 0.04 -3.13 direct sport > competition discipline > eSports
television television 0.04 -3.17 direct arts, culture, entertainment and media > mass media > television
health health 0.04 -3.22 ↑derived from 20000458 health
disease and condition disease-and-condition 0.04 -3.22 ↑derived from 20000458 health > disease and condition
mental health and disorder mental-health-and-disorder 0.04 -3.22 direct health > disease and condition > mental health and disorder
natural science natural-science 0.04 -3.26 direct science and technology > natural science
social sciences social-sciences 0.04 -3.31 ↑derived from 20000747 science and technology > social sciences
history history 0.04 -3.31 direct science and technology > social sciences > history
disaster, accident and emergency incident disaster-accident-and-emergency-incident 0.03 -3.53 direct disaster, accident and emergency incident
human interest human-interest 0.03 -3.54 direct human interest
politics and government politics-and-government 0.03 -3.57 direct politics and government
conflict, war and peace conflict-war-and-peace 0.03 -3.64 direct conflict, war and peace
health treatment and procedure health-treatment-and-procedure 0.02 -3.67 direct health > health treatment and procedure
visual arts visual-arts 0.02 -3.79 ↑derived from 20000036 arts, culture, entertainment and media > arts and entertainment > visual arts
photography photography 0.02 -3.79 direct arts, culture, entertainment and media > arts and entertainment > visual arts > photography
family family 0.02 -3.79 direct society > family
Tabletop gaming tabletop-gaming 0.02 -3.81 direct lifestyle and leisure > leisure > game > Tabletop gaming
award and prize award-and-prize 0.02 -3.86 direct human interest > award and prize
biology biology 0.02 -4.00 direct science and technology > natural science > biology
music music 0.02 -4.07 direct arts, culture, entertainment and media > arts and entertainment > music
religion religion 0.02 -4.09 direct religion
exercise and fitness exercise-and-fitness 0.02 -4.11 direct lifestyle and leisure > wellness > exercise and fitness
wellness wellness 0.02 -4.11 ↑derived from 20001239 lifestyle and leisure > wellness
climate change climate-change 0.02 -4.17 direct environment > climate change
board game board-game 0.02 -4.18 direct lifestyle and leisure > leisure > game > board game
consumer goods consumer-goods 0.02 -4.18 ↑derived from 20001160 economy, business and finance > products and services > consumer goods
handicrafts handicrafts 0.02 -4.18 direct economy, business and finance > products and services > consumer goods > handicrafts
weather weather 0.01 -4.46 ↑derived from 20001128 weather
weather forecast weather-forecast 0.01 -4.46 direct weather > weather forecast
diet diet 0.01 -4.47 direct health > health treatment and procedure > diet
lifestyle lifestyle 0.01 -4.62 ↑derived from 20001257 lifestyle and leisure > lifestyle
house and home house-and-home 0.01 -4.62 ↑derived from 20001257 lifestyle and leisure > lifestyle > house and home
gardening gardening 0.01 -4.62 direct lifestyle and leisure > lifestyle > house and home > gardening
card game card-game 0.01 -4.70 direct lifestyle and leisure > leisure > game > card game
public health public-health 0.01 -4.77 direct health > public health
travel and tourism travel-and-tourism 0.01 -4.89 direct lifestyle and leisure > leisure > travel and tourism
food and drink enthusiasm food-and-drink-enthusiasm 0.01 -4.98 direct lifestyle and leisure > leisure > hobby > food and drink enthusiasm

← Back to posts

feedtagger 0.1.0-dev model: modernbert-base-zeroshot-v2.0/int8@all-s256 2115 posts 0 unclassified min score 0.75