TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to generate URL in Asian languages?

1 pointsby ugur2ndalmost 2 years ago
I developed a micro SaaS tool. In this tool, people can add things. And it gives titles to the things they add. When you give a title, this title turns into a URL with a permalink.<p>For example: &quot;Your Welcome&quot; =&gt; &quot;your-welcome&quot;<p>But when Asian languages are involved, the system explodes.<p>For example: &quot;这是一个例子。&quot; =&gt; &quot;这是一个例子。&quot;<p>The website does not understand this and takes it to the error page. Call it &quot;Zhè shì yīgè lìzi.&quot; If I could print it like this maybe it would work, but I searched and couldn&#x27;t.<p>I tried with URLEncode&#x2F;decode, still didn&#x27;t work.<p>Maybe you know. If there are Asian entrepreneurs among us or people who have worked in that field, can it help?<p>Thank you.

1 comment

dave4420almost 2 years ago
Web browsers will take the IRI (Internationalised Resource Identifier; think of it as a URI but containing non-ascii characters), and turn it into a URI (containing a load of percent-encoded utf-8 bytes instead of non-ascii characters) and send that to the web server.<p>So your website will need to decode the percent-encoded utf-8 bytes into Unicode characters.<p>(On phone, simplifying a bit. I encourage you to read the relevant RFC.)