0

I don't know what else to try; each time I render a twig template, I get those symbols:

Instead of "á" for example.

Each template, extends a "base" template, which cointains:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

But that symbol is still shown. I checked sourcecode of the page rendered, and that meta tag line appears there.

Is there any global configuration I've to set to avoid this?

Thank you!

Edit: Note that I'm using TWIG. Maybe some Twig parameters are missconfigured?

enter image description here

Reinherd
  • 5,476
  • 7
  • 51
  • 88
  • Symfony2 by default uses UTF8. I guess your text editor/IDE does not save files in that encoding. – Crozin Feb 16 '13 at 16:00
  • @Crozin i've added a screenshot with chrome sourcecode and netbeans code. check it out :) – Reinherd Feb 16 '13 at 16:07
  • Check whether UTF8 is being used in HTTP Response header. Chrome -> F12 -> Network -> reload your website -> check `Content-Type` response header from the very first response. – Crozin Feb 16 '13 at 16:19
  • Finally got it. http://stackoverflow.com/questions/5034891/how-do-you-set-the-encoding-to-utf-8-in-netbeans-6-9 It was some sort of problem with Netbeans. – Reinherd Feb 16 '13 at 16:25
  • @SergiCastellsaguéMillán can you please add an answer to this question how you solved it and accepts that as an aswer? – Wouter J Feb 17 '13 at 22:15

1 Answers1

-4

You should use &agrave;, see the html special characters

To do this dynamically: look at the php function htmlspecialchars()

Vince V.
  • 3,115
  • 3
  • 30
  • 45
  • Well, I could use "oacute" or whatever, but that's not the fact. I can't manually edit each character from website. Its a dynamic content, which may contain those kind of letters. – Reinherd Feb 16 '13 at 16:01
  • Using html special characters to fix a global encoding problem is not a thing to use. – Thomas Ruiz Feb 17 '13 at 22:16
  • Updated description with a function that does this dynamically. Normally twig does this automatically for you. however if you use the raw parameter twig doesn't do this. (http://stackoverflow.com/questions/11557010/twig-use-quotation-mark-as-separator-for-join-filter). But that wasn't the problem too, it wa a thing with his IDE. – Vince V. Feb 18 '13 at 07:37