Sinatra decodes a route's splat before handing it to the block, so an article link like /kiwix/content/wikipedia/Dlhé_diely arrived as raw UTF-8, not percent-encoded. URI#path= rejects that outright (URI::InvalidComponentError) rather than escaping it, which .proxy's rescue turned into a silent nil -> every article link 502'd, while the search results page linking to them worked fine (its own path, /kiwix/search, is plain ASCII).