0

I'm developing a website with brazilian characters using Zend Framework and my navigation menu items are inside a database.

I've double checked my character encoding in the HTML meta tag, in the files itself and my database. Everything is set to UTF-8 and my whole website is rendering fine (including my menu items which has accented character.

AlthoughI'm using Zend_Navigation for rendering a breadcrumb and it's not going very well. See the image below:

alt text

Missão is what I have in my database. Unfortunately, it's not becoming ã instead. I don't know why.


I'm also using Zend_Navigation in my admin module for both Breadcrumb and Menu which render perfectly. The difference is that I'm using a XML in my admin module and Arrays in my default module (which is the problematic one).

I tried to write the XML from the Config object using Zend_Config_Writer_Xml. Then, I checked the file and it was written correctly: <label>Informa&ccedil;&otilde;es</label>. Although, in order to the XML render correctly, it's enough to write just <label>Informações</label> (that's what I have in the admin module navigation XML).

Well, what if I write Informações directly in the array then ask it to write the XML? I tried this and I got <label>Informa&#xE7;&#xF5;es</label> which doesn't work, also.

I'd like to come up with a solution 'cause I'm running out of time

Rodrigo Souza
  • 7,162
  • 12
  • 41
  • 72

1 Answers1

0

I'd say the breadcrumb helper is escaping the output automatically. There is a hardcoded call to escape() in renderStraight(). You can verify by looking at the sourcecode and see if the & is an &amp;.

If you are already using UTF-8, you should not use entities for your special chars. Just use their regular representation. To get around XML converting it to entities make sure the XML file is set to write UTF-8.

If all that doesnt help, check that the webserver is serving the Response in UTF-8. Meta Tags are just fallbacks and won't be considered if the Webserver sends an encoding. Although this is unlikely the reason if other entities show fine.

Community
  • 1
  • 1
Gordon
  • 312,688
  • 75
  • 539
  • 559