Handlebars icon indicating copy to clipboard operation
Handlebars copied to clipboard

Added support for spanish special chars

Open infinito84 opened this issue 9 years ago • 6 comments

Hi,

I was testing Handlebars PHP with this template:

handlebars0

But, the template wasn't working with spanish accents: (chars like í ñ) and the Template was showing a blank text.

handlebars1

So, the present solution adds support applying the utf8_encode and saving the text of blank issue:

handlebars2

Regards,

infinito84 avatar Jun 06 '15 19:06 infinito84

That function does not do what you think it does.

bobthecow avatar Jun 06 '15 21:06 bobthecow

Sorry, what does it do?

infinito84 avatar Jun 07 '15 02:06 infinito84

It converts from one specific encoding into utf-8. So while it might work for your data source, it will break things for anyone who isn't using that encoding.

bobthecow avatar Jun 07 '15 04:06 bobthecow

For example, if someone already has utf-8 strings, it does this:

screen shot 2015-06-06 at 9 45 55 pm

bobthecow avatar Jun 07 '15 04:06 bobthecow

Yes, you right, I think to know how to solvet it.

infinito84 avatar Jun 07 '15 04:06 infinito84

I tried with ENT_IGNORED but disappears the chars, and tried to with ENT_SUBSTITUTE but converts my chars in weird chars, i searched in Google and the answers that i found, didn't seem me much. Do you have some idea for improving this solution?

infinito84 avatar Jun 07 '15 05:06 infinito84