Skip to content

fix utf8 in url#1143

Closed
alexsorinpop wants to merge 1 commit intoPerlDancer:mainfrom
alexsorinpop:master
Closed

fix utf8 in url#1143
alexsorinpop wants to merge 1 commit intoPerlDancer:mainfrom
alexsorinpop:master

Conversation

@alexsorinpop
Copy link
Copy Markdown

fixed utf8 in urls and added a test for it

@veryrusty
Copy link
Copy Markdown
Member

Thanks @alexsorinpop ! Looks ok and matches rfc3986.

This also decodes route params to characters (which is desirable). We should add tests for this to make it explicit. I'm (slowly) working through some other corner cases (eg. when there are undecoded path elements, such as when behind a proxy).

@xsawyerx
Copy link
Copy Markdown
Member

👍

This reminds me that we should attempt to use Unicode::UTF8 if available. Path::Tiny does that1, 2, 3. Does anyone want to open a ticket for this enhancement?

@xsawyerx xsawyerx added the Bug label Mar 28, 2016
@alexsorinpop
Copy link
Copy Markdown
Author

So after more digging around it seems that as with every utf8 issue you can't just add that and fix utf8. Go figure.

I found that the STDERR is not opened as utf8 so it might crash the whole app when a utf8 url errors with some syntax in template toolkit and what I found to be really bizarre is that the session is not always remembered... sometimes it will remember your session and the next url that you open will not work anymore. I tested this with ascii urls and I never get that, but I cannot say that I found a way to reproduce this behavior all the time with utf8 urls. I will still dig around

@xsawyerx
Copy link
Copy Markdown
Member

Any updates about this?

@cromedome
Copy link
Copy Markdown
Contributor

@alexsorinpop It's been a while :) Any updates to share? Thanks!

@xsawyerx
Copy link
Copy Markdown
Member

xsawyerx commented Apr 1, 2022

I suggest we close this and open a ticket that refers to this implementation and discussion to fix the matter.

@cromedome
Copy link
Copy Markdown
Contributor

cromedome commented Jul 26, 2023

@xsawyerx seconded. Are you volunteering to open the new ticket? ;)

@xsawyerx
Copy link
Copy Markdown
Member

There's #1759 which I think would resolve this. I'll add the test to that PR.

xsawyerx added a commit that referenced this pull request Jan 26, 2026
@xsawyerx
Copy link
Copy Markdown
Member

Test added to #1759 and it passes there.

xsawyerx added a commit that referenced this pull request Feb 8, 2026
xsawyerx added a commit that referenced this pull request Feb 8, 2026
cromedome pushed a commit that referenced this pull request Mar 5, 2026
@cromedome
Copy link
Copy Markdown
Contributor

Resolved by #1759.

@cromedome cromedome closed this Mar 5, 2026
cromedome added a commit that referenced this pull request Mar 12, 2026
    [ BUG FIXES ]
    * GH #686: Fix: to_json is double encoding UTF8 (Sawyer X)
    * GH #863: Fix case insensitive system confusion (Sawyer X)
    * GH #1124: Fix: charset config option is mostly ignored (Sawyer X)
    * GH #1143: Fix utf8 in URL (Sawyer X, Sorin Pop)
    * GH #1449, 1630: Make plugin DSL keyword app-specific (Sawyer X)
    * GH #1772: t/dsl/send_file.t fails with content_type-related errors
      (Sawyer X)
    * GH #1773: t/dsl/send_as.t throws json-related warnings (Jason
      A. Crome)
    * GH #1774: t/hooks.t throws void warnings (Jason A. Crome)
    * GH #1777: Properly unlink file uploads on Windows (Sawyer X)

    [ ENHANCEMENTS ]
    * GH #763: Strict config mode; warn on unknown config keys with
      opt-out (Sawyer X)
    * GH #763: Default strict config to off, but scaffold new apps with
      stict config enabled (Jason A. Crome)
    * GH #1073: Get multiple session cookie values at once with clear
      method (Sawyer X)
    * GH #1264: Move to Path::Tiny (Sawyer X)
    * GH #1323: Allow fully qualified namespaces for all engines (Russell
      @veryrusty Jenkins)
    * GH #1594: Use Unicode::UTF8 if available (Sawyer X)
    * GH #1664: Stop sending double server headers (Sawyer X)
    * GH #1709: `send_as` should use the full serializer, including hooks
      (Sawyer X)
    * PR #1757: Remove api_version, improve dispatching loop (Sawyer X)
    * PR #1758: Move MIME ownership to app (Sawyer X)
    * PR #1767: Turn off strict_config for noisy tests (Jason A. Crome)
    * PR #1780: Add package name capability to logger output (Mikko
      Koivunalho)

    [ DOCUMENTATION ]
    * GH #1431: Better document behavior of views setting (Jason A. Crome)
    * PR #1749, #1750: Fix broken manual and tutorial links (Gil Magno,
      Jason A. Crome)
    * PR #1753: Fix structure of config docs (Mikko Koivunalho)
    * PR #1762: Remove keyword logger from DSL document (Mikko Koivunalho)

    [ DEPRECATED ]
    * None

    [ MISC ]
    * PR #1776: Remove "Powered by..." from the error page (Jason A. Crome)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants