dave
dave

Reputation: 5

add icon to html code title

This is not a favicon as others had corrected another post.

This is how Expedia page source code looks:

<title data-sctid="title" data-sct-hidden="true">🏨 Atlantic City Hotels: Find 122 Cheap Hotel Deals in Atlantic City, NJ | Expedia</title>

the result page in google shows this http://goo.gl/YEjujq

I tried to insert 🏨 into

  $this->set('title_for_layout', "🏨 Atlantic City Hotels: 28 Cheap Hotel Deals AtlanticCity.com");

but can not save since I get this error

Text encoding Western (ISO Latin 1) isn’t applicable.

Upvotes: 0

Views: 128

Answers (2)

ddavison
ddavison

Reputation: 29032

Just as Tsahi says, that character is not valid in that particular encoding.

What you can do, is try its unicode or html character codes:

$this->set('title_for_layout', "&#127976; Atlantic City Hotels...

or

$this->set('title_for_layout', "\uD83C\uDFE8 Atlantic City Hotels...

Upvotes: 1

Tsahi Asher
Tsahi Asher

Reputation: 1810

that's because this character is (probably) not part of the Latin 1 code page. you should encode your page in Unicode (UTF-8 is what's usually being used) for it to work.

Upvotes: 0

Related Questions