Answers.Body: <p>I try to avoid using tag titles in urls. Unlike categories, tags don't have a url-friendly slug, and the tag title itself can contain all manner of punctuation. So you have to clean up the tag somehow (<a href="https://github.com/boboldehampsink/slugify/" rel="nofollow">slugify</a> e.g.), and later you have to try to reconstruct the tag from the slugified value, which isn't always even possible (different tag titles can slugify to the same value). What I use instead is the tag id, which is nicely unambiguous and url-friendly.</p>
  
  <p>Your route to define the url would still look like:</p>
  
  <pre><code>actualites/tag/[tag] -&gt; whatever_template
  </code></pre>
  
  <p>And you would retrieve the actual tag like this:</p>
  
  <pre><code>{% set tag = craft.tags.id(tag).first() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-15T06:59:30.253Z
Answers.LastActivityDate: 2015-01-15T06:59:30.253Z
Answers.UserDisplayName: Marion Newlevant
Answers.Body: <p>There is a <a href="http://buildwithcraft.com/docs/config-settings#limitAutoSlugsToAscii" rel="noreferrer">general config setting</a> for it:</p>
  
  <pre><code>'limitAutoSlugsToAscii' =&gt; true,
  </code></pre>
  
  <blockquote>
    <p>Limits automatically-generated slugs to ASCII characters. When there
    is an obvious ASCII version of a character (e.g. ñ → n), it will be
    used. Other characters will be removed.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-14T14:35:26.493Z
Answers.LastActivityDate: 2015-01-14T14:41:48.860Z
Answers.LastEditDate: 2015-01-14T14:41:48.860Z
Answers.UserDisplayName: KSPR
Answers.Body: <p>I suspect it's something else going on in your code.</p>
  
  <p>I just did a simple test on a fresh install of Craft after adding one tag called <code>Traçage électrique</code> to the default entry and tag field that was created:</p>
  
  <pre><code>{% set tag = craft.tags.name('Traçage électrique').first() %}
  
  Tag Length = {{ tag|length }}&lt;br /&gt;
  
  {% set entries = craft.entries.section('news').relatedTo().limit(5).find() %}
  
  Entry Length = {{ entries|length }}
  </code></pre>
  
  <p>And it appears to be working fine:</p>
  
  <pre><code>Tag Length = 1
  Entry Length = 1
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-14T20:33:56.560Z
Answers.LastActivityDate: 2015-01-14T20:33:56.560Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>I did some digging in the database, following Brad advices.
  First, the code was ok. Here the one I used.</p>
  
  <pre><code>{% set current_tag = craft.tags.name(tag).first() %}
  {% set newsCriteria = craft.entries.section('news').relatedTo(current_tag).limit(5) %}
  </code></pre>
  
  <p>I find out that I had multiple tags names the same in the table "craft_content".
  I assume that the last one was associated to the news, and the first one was the one queried by the "name(tag).first()" call. And so there was no news associated with this tag.</p>
  
  <p>I deleted all the tags in the craft_content table, and re-created them in the backoffice.
  Now it works perfectly.</p>
  
  <p>thanks for all your help</p>
  
  <p>Nicolas</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-16T10:55:08.520Z
Answers.LastActivityDate: 2015-01-16T10:55:08.520Z
Answers.UserDisplayName: Nicolas Binet
Body: <p>I'm having a problem getting entries related to a tag with accentuated characters.
  Here is what the URL looks like : fr.craft.dev/actualites/tag/Traçage%20électrique</p>
  
  <p>The same page work fine with a tag without accents.</p>
  
  <p>Is there anything special to do to fix this on my side ?
  Or is-it a problem with craft ?
  Here is my code :</p>
  
  <pre><code>{% set tag = craft.tags.name(tag).first() %}
  {% set newsCriteria = craft.entries.section('news').relatedTo(tag).limit(5) %}
  </code></pre>
  
  <p>Thanks for your help.</p>
  
  <p>Nicolas</p>
  
Tags: <tags>
Title: Problem with accents in tags & URL
ThreadText: # Problem with accents in tags & URL
  
  (Asked by: username_0 on 2015-01-14)
  
  I'm having a problem getting entries related to a tag with accentuated characters.
  Here is what the URL looks like : fr.craft.dev/actualites/tag/Traçage%20électrique
  
  The same page work fine with a tag without accents.
  
  Is there anything special to do to fix this on my side ?
  Or is-it a problem with craft ?
  Here is my code :
  
  ```
  {% set tag = craft.tags.name(tag).first() %}
  {% set newsCriteria = craft.entries.section('news').relatedTo(tag).limit(5) %}
  
  ```
  
  Thanks for your help.
  
  username_0
  
  **Tags:** tags
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2015-01-15. Score: 2 | Accepted answer
  
  I try to avoid using tag titles in urls. Unlike categories, tags don't have a url-friendly slug, and the tag title itself can contain all manner of punctuation. So you have to clean up the tag somehow ([slugify](https://github.com/boboldehampsink/slugify/) e.g.), and later you have to try to reconstruct the tag from the slugified value, which isn't always even possible (different tag titles can slugify to the same value). What I use instead is the tag id, which is nicely unambiguous and url-friendly.
  
  Your route to define the url would still look like:
  
  ```
  actualites/tag/[tag] -> whatever_template
  
  ```
  
  And you would retrieve the actual tag like this:
  
  ```
  {% set tag = craft.tags.id(tag).first() %}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2015-01-14. Score: 5
  
  There is a [general config setting](http://buildwithcraft.com/docs/config-settings#limitAutoSlugsToAscii) for it:
  
  ```
  'limitAutoSlugsToAscii' => true,
  
  ```
  
  > Limits automatically-generated slugs to ASCII characters. When there
  > is an obvious ASCII version of a character (e.g. ñ → n), it will be
  > used. Other characters will be removed.
  
  
  ---
  
  ### Answer by username_3 on 2015-01-14. Score: 1
  
  I suspect it's something else going on in your code.
  
  I just did a simple test on a fresh install of Craft after adding one tag called `Traçage électrique` to the default entry and tag field that was created:
  
  ```
  {% set tag = craft.tags.name('Traçage électrique').first() %}
  
  Tag Length = {{ tag|length }}<br />
  
  {% set entries = craft.entries.section('news').relatedTo().limit(5).find() %}
  
  Entry Length = {{ entries|length }}
  
  ```
  
  And it appears to be working fine:
  
  ```
  Tag Length = 1
  Entry Length = 1
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2015-01-16. Score: 0
  
  I did some digging in the database, following username_3 advices.
  First, the code was ok. Here the one I used.
  
  ```
  {% set current_tag = craft.tags.name(tag).first() %}
  {% set newsCriteria = craft.entries.section('news').relatedTo(current_tag).limit(5) %}
  
  ```
  
  I find out that I had multiple tags names the same in the table "craft\_content".
  I assume that the last one was associated to the news, and the first one was the one queried by the "name(tag).first()" call. And so there was no news associated with this tag.
  
  I deleted all the tags in the craft\_content table, and re-created them in the backoffice.
  Now it works perfectly.
  
  thanks for all your help
  
  username_0
  
  
  ---
  
  