Failure to parse URLs with Korean text in the path #2
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: shadowfacts/Gemini#2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If a URL is entered that contains Korean text within the path, such as
gemini://namu.blue/쌍록/
, Rocketeer does not attempt to load the page.If you attempt to navigate to a page that contains a link with Korean in its path, that app will crash. Example:
gemini://namu.blue/
This behavior applies to folder names and file names in a URL's path.
I've percent encoded the problematic URLs, and it seems that Rocketeer is having trouble parsing them still. The following URL, for example, crashes Rocketeer on my device:
gemini://namu.blue/%EC%8C%8D%EB%A1%9D/2020-10-02-%EC%A0%9C%EB%AF%B8%EB%8B%88%EC%9D%98_%EC%B2%AB_%ED%95%9C%EA%B8%80_%EC%BA%A1%EC%8A%AC.gmi
I noticed the same problem when trying to load my site, which has some Japanese text in the paths, and from what I can see the problem is in
GeminiFormat/GeminiParser.swift
No proper patch or PR, but changing line 42 to the following seems to fix the problem (at least partially - mieum's percent encoded URL still doesn't seem to work...?):
let urlString = String(line[urlStart..<urlEnd]).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!