In xml you also need to strore it encoded - so when you store "&" in the xml, it comes out as a simple amperstand on the other end. If you need an encoded one in your output, you need to double-encode it in the xml: "&".
On Mon, Jan 17, 2011 at 16:01, chrigu <[email protected]> wrote: > Hi everybody, > > I'm using I18n tags stored in xml files. Recently I checked my page > with W3C-Validator (validator.w3.org) and received the following > error: character "&" is the first character of a delimiter but > occurred as data. > > I checked my source code and saw that the Ampersand (&) is decoded. I > checked in the messages.xml and there it is properly stored as html > entity (& ;) as it should be. I checked other special characters > like umlauts there I have the same problem, they are not encoded. My > browser displays these characters correctly but the W3C Validator > complains about them (see above). > > If I do an echo utf8_encode(__("My translation contains an > ampersand")); it does the trick but I don't wanna add an utf8_encode > to every internationalisation-tag which could contain special chars. > Can I overwrite somehow the __(key) function or is this a bug which > needs to be reported? > > > Thank you for any help!!! > Chrigu > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
