Kanji/Kana in topic permalinks breaks navigation directly to a topic


#1

Earlier today, someone posted a topic with some hiragana and kanji in the topic title:

Try copying the URL of that topic and pasting it into a new tab. The page doesn’t load for me on Chrome, Safari, or Firefox on macOS. I suspect that this is because there is kanji and hiragana in the permalink. I put some kanji and hiragana in the title of this topic to test this theory.

I’m guessing Ember doesn’t handle routes with non-ascii characters correctly. Links to the topic work, however, because Ember handles transitions within an app that’s already loaded differently.


Can't access forum threads with kana/kanji in the title?
Jitai (字体): The font randomizer that fits
Forum language changing randomly when on auto
#2

Nice find. Surely I’m not the first person to put Japanese characters into a title topic! :smiley:


#3

It looks like navigating directly to this topic doesn’t work either. I thought it was a Discourse issue, but I experimented on the Discourse sandbox and it stripped the non-ASCII characters out of the permalink, so it works.


#5

Ha! I’m going to let the Discourse maintainers know about the bug shortly. They’ve been very responsive in the past, and this one’s kind of a doozy for people using non-ASCII permalinks (like us).


#6

As noted above this seems to be specific to WK’s Discourse instance

Edit: Wait, does the WK Discourse instance have non-ASCII char stripping in permalinks turned off?


#7

Yep, can confirm. Just emailed Wanikani about this issue as well.


#8

Yep, we turned it off. It made the URLs for the … well … forums a little less meaningful when we stripped them out.


#9

Hmmm, the problems is related to permalink/slug encoding, but not the entire cause. They’ve clearly supported permalinks with non-ASCII characters in the past, but a recent change looks like it’s generating multiple redirects between the encoded and un-encoded versions of the URL.

Hold tight, everybody. :slight_smile:


#10

Yep, I experienced a related issue when trying to post a link to a definition on Weblio earlier tonight. Clicking Paste kept mangling it into all the letters and % crap, which brought up a 404 on weblio. Eventually I manually typed it in and made sure the link was not alone on the line, so it converted into a link rather than a link-box, and that made it work. (A workaround for now while Discourse hopefully fixes this back.)

See this post here:

I'm looking for a word that I've heard in One Piece

Thanks for looking into it for us, @oldbonsai!


#11

Okay I believe a solution for this is still being worked on. You can track progress for this over on the Discourse Meta forum: https://meta.discourse.org/t/automatic-encoding-of-parsed-url-params/67232/17


Redirection Issue with Kanji in page URL
#12

Related?

I think because there’s an emoji star in the URL.

My browser was trying to load the page directly from my last time online. (Firefox, Windows 7)


#13

Yep. It’s any unencoded UTF-8/UTF-16 character that shows up in the URL, which includes emoji.


#14

That’s what I thought. Last activity in the thread Blake posted was 14 hours ago, and said it’s mainly because Discourse is on Rails 4, but there’s a fix in Rails 5, apparently.


#15

For now, I changed some topic titles where the Kana/Kanji weren’t necessary.
It helps I think.