|slice filter does not work with special characters I try to use the slice filter in order to limit a link to a specific amount of characters. The field that I render is a link field and my code is the following:

{% set title_text = title|render|striptags %}
&lt;span&gt; 
     {{ title_text|length &gt; 65 ?
         title_text|slice(0,65)  :
         title_text|striptags}}
&lt;/span&gt;


Unforturnately some characters like the apostrophe are not rendered appropriately.

So instead of rendering "I've learned", they render "I&amp; #039;ve learned"
Actually the culprit is |striptags 


  The problem with using twig's |striptags is double encoding of html entities,
  not markup, so &amp; becomes &amp; and then &amp;amp; – Berdir
  
  source: How do I get the raw field value in a twig template?


If your setup relies on you running striptags last, you will need to do this all of this magic in a preprocess function with php setting a variable here and then printing your formatted variable on twig.