Answers.Body: <p>This isn't really an answer, but my investigating was too long for a comment.</p>
  <p>Ultimately, <code>craft.app.request.url</code> gets routed through Yii's <a href="https://github.com/yiisoft/yii2/blob/master/framework/web/Request.php#L1052" rel="nofollow noreferrer">resolveRequestUri()</a> and likely gets pulled from <a href="https://github.com/yiisoft/yii2/blob/master/framework/web/Request.php#L1057" rel="nofollow noreferrer">$_SERVER['REQUEST_URI']</a>.</p>
  <p>Anything coming from <code>$_SERVER['REQUEST_URI']</code> is always going to be URL encoded so using this in a template:</p>
  <p><a href="https://i.sstatic.net/HigGX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HigGX.png" alt="enter image description here" /></a></p>
  <p>I get this URL encoded output in a browser:</p>
  <p><a href="https://i.sstatic.net/Ytk1R.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ytk1R.png" alt="enter image description here" /></a></p>
  <p>Unfortunately, Twig doesn't have a <code>|url_decode</code> <a href="https://github.com/twigphp/Twig-extensions/issues/60" rel="nofollow noreferrer">filter</a>, so you'd need to write a quick custom Twig filter that uses PHP's <a href="https://www.php.net/manual/en/function.urldecode.php" rel="nofollow noreferrer">urldecode()</a> method.</p>
  <p>But it actually looks like you're having a character encoding issue first because of the <code>����</code> and I'm not exactly sure what's causing that.</p>
  <p>My guess is its environment configuration related (I'm using <a href="https://getnitro.sh" rel="nofollow noreferrer">https://getnitro.sh</a> in a fairly default setup for testing).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-30T22:25:35.793Z
Answers.LastActivityDate: 2021-03-30T22:25:35.793Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm trying to get url from request,</p>
  <pre><code> {{ craft.app.request.url }}
  </code></pre>
  <p>but the uri is chinese, like &quot;localhost/測試&quot;,</p>
  <p>it print out &quot;http://localhost/����&quot;</p>
  <p>did i miss some setting in craft CMS ?</p>
  <p>Thank you.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-25T08:05:07.107Z
Comments.Text: http://localhost//����
Comments.UserDisplayName: ivesho
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-25T22:56:25.980Z
Comments.Text: Guessing you need to set `<meta charset="UTF-8">` in your template?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-29T06:08:33.610Z
Comments.Text: @BradBell Thanks your help! I trid, but not working.
Comments.UserDisplayName: ivesho
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-29T23:13:03.503Z
Comments.Text: Maybe a server-side thing? If you go to Utilities->PHP Info in the Craft control panel and search for `default_charset`, what is it set to?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-30T02:27:39.433Z
Comments.Text: The setting is "UTF-8".  
  I try Request class methods, the getAbsoluteUrl() has same problem, "http://localhost/����".  But getFullPath(), getFullUri() and getSegment(1) can show chinese, "測試" .
  Sorry I am new in Craft CMS and programing.
Comments.UserDisplayName: ivesho
Tags: <craft3><url><request>
Title: how to get request url?
ThreadText: # how to get request url?
  
  (Asked by: username_0 on 2021-03-25)
  
  I'm trying to get url from request,
  
  ```
   {{ craft.app.request.url }}
  
  ```
  
  but the uri is chinese, like "localhost/測試",
  
  it print out "http://localhost/����"
  
  did i miss some setting in craft CMS ?
  
  Thank you.
  
  **Tags:** craft3, url, request
  
  > **Comments:**
  > **username_0**: http://localhost//����  
  > **username_1**: Guessing you need to set `<meta charset="UTF-8">` in your template?  
  > **username_0**: @username_1 Thanks your help! I trid, but not working.  
  > **username_1**: Maybe a server-side thing? If you go to Utilities->PHP Info in the Craft control panel and search for `default_charset`, what is it set to?  
  > **username_0**: The setting is "UTF-8".   I try Request class methods, the getAbsoluteUrl() has same problem, "http://localhost/����".  But getFullPath(), getFullUri() and getSegment(1) can show chinese, "測試" . Sorry I am new in Craft CMS and programing.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-30. Score: 1
  
  This isn't really an answer, but my investigating was too long for a comment.
  
  Ultimately, `craft.app.request.url` gets routed through Yii's [resolveRequestUri()](https://github.com/yiisoft/yii2/blob/master/framework/web/Request.php#L1052) and likely gets pulled from [$\_SERVER['REQUEST\_URI']](https://github.com/yiisoft/yii2/blob/master/framework/web/Request.php#L1057).
  
  Anything coming from `$_SERVER['REQUEST_URI']` is always going to be URL encoded so using this in a template:
  
  [![enter image description here](https://i.sstatic.net/HigGX.png)](https://i.sstatic.net/HigGX.png)
  
  I get this URL encoded output in a browser:
  
  [![enter image description here](https://i.sstatic.net/Ytk1R.png)](https://i.sstatic.net/Ytk1R.png)
  
  Unfortunately, Twig doesn't have a `|url_decode` [filter](https://github.com/twigphp/Twig-extensions/issues/60), so you'd need to write a quick custom Twig filter that uses PHP's [urldecode()](https://www.php.net/manual/en/function.urldecode.php) method.
  
  But it actually looks like you're having a character encoding issue first because of the `����` and I'm not exactly sure what's causing that.
  
  My guess is its environment configuration related (I'm using <https://getnitro.sh> in a fairly default setup for testing).
  
  
  ---
  
  