FooBar
FooBar

Reputation: 6138

Typeahead.js - Special characters are returned as "æ" etc

I have a strange problem with Twitters Typeahead. If a value and name is:

indlæg

It will display correctly in the suggestion link, but as soon as you mark it, and the value is pasted into the input box, the æ is gone, and then looks like this:

Indlæg

I have verified the source is UTF-8 and everything else on the page also. My only thought is, that it has something to do with the typeahead.

Any ideas?

Upvotes: 1

Views: 610

Answers (1)

FooBar
FooBar

Reputation: 6138

After hours of debugging, I found the solution to the problem, which was so simple. I found out, that the problem that nothing to do with the typeahead.js module.

I simply had to decode the entities using: html_entity_decode()

My bad!

Upvotes: 1

Related Questions