Wedge
Public area => The Pub => Off-topic => Topic started by: MultiformeIngegno on February 15th, 2013, 04:31 PM
-
On my site I have a script that pulls the entries of an RSS feed and displays them (this is a portion):
<li>
<a href="<?php echo $item->get_permalink(); ?>" title="<?php echo esc_html( $item->get_title() ); ?>" rel="external"><?php echo esc_html( $item->get_title() ); ?></a>
</li>
It works like a charm, the only oddity I noticed is when I deal with "special" chars. They're displayed just fine in the page, but the title="" tooltip replaces them with □□□□ (not encoded properly):
(http://img441.imageshack.us/img441/2227/titletag.png)
The problem is that the code that outputs text and title="" is the same. And the page is UTF-8. AND (last oddity :P) browsing the source code I can see the chars properly!
(http://img11.imageshack.us/img11/779/codejap.png)
Any clue?
I'm writing this just for curiosity.. I don't care much about this "glitch"! :D
-
No, it's not an encoding problem. It simply means that those characters are not available in the font Windows is using for tooltips. There's no way around it without rolling your own tooltips in HTML.
-
No, it's not an encoding problem. It simply means that those characters are not available in the font Windows is using for tooltips. There's no way around it without rolling your own tooltips in HTML.
Uh, thanks! Seems sensed. so if I install (say) Japanese language on the system the chars should display fine? BTW, what's the default font on Windows (7/8)? Font on the page is Segoe UI.
EDIT: I edited my post and when I came back to the topic, the post was unread.. is this by design?
EDIT2: Uh, edited again but this time it was read.
-
It's nothing to do with the font for the page. You as a web developer have precisely zero control over what Windows does with tooltips.
Windows 7 makes it almost deliberately awkward to find it, too. What's curious is that Windows 7 itself uses Segoe UI by default. Earlier versions of Windows used different fonts (usually Tahoma if memory serves) which very firmly had troubles, but it would seem that something changed in Win Vista+.
Related thing I found: https://code.google.com/p/chromium/issues/detail?id=102449
-
EDIT: I edited my post and when I came back to the topic, the post was unread.. is this by design?
There's a topic about that, like....... right below yours or not far :whistle: