DotDragnet
May 22, 2012, 02:23:31 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Bizarre entity reference issue  (Read 1469 times)
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« on: January 31, 2008, 07:59:31 PM »

In IE7, one part of a page uses:

• to represent a bullet point manually. This displays as a bullet no problem.

Elsewhere on the page, the same entity reference produces a vertical "pipe" about 3 times thicker than a | mark.

I'm getting the same happening with – too. Sometimes it works, sometimes not.

Anyone come across this?
Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
JasonD
Global Moderator
Hero Member
*****
Posts: 546



View Profile Awards
« Reply #1 on: January 31, 2008, 08:14:19 PM »

No such character, 128-159 is windows-1252. A bullet can be found in its rightful place at 8226.
Logged
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« Reply #2 on: January 31, 2008, 09:03:13 PM »

Sorry, forgot to mention I'm saving in utf-8

Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
JasonD
Global Moderator
Hero Member
*****
Posts: 546



View Profile Awards
« Reply #3 on: January 31, 2008, 10:41:00 PM »

It makes no difference what encoding the file is in, numeric entity references always refer to unicode character points. 149 (0x95) may be a bullet in windows-1252 is nothing useful in unicode. 8226 (U+2022) is a bullet.

But if you are saving the file as utf-8 why are you even bothering with entity references? Just use whatever character you want.

http://www.unicode.org/charts/PDF/U0080.pdf
http://www.unicode.org/charts/PDF/U2000.pdf
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
Logged
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« Reply #4 on: January 31, 2008, 11:14:36 PM »

I tried doing that. The reason I'm saving in unicode is to allow me to do that, but it won't display certain characters. So I've entity replaced them. How I got to #0149;? I opened charmap, located the bullet character, and used the reference posted from that. It displays fine as a bullet on windows firefox, mac firefox, windows ie7, windows ie6, mac safari. But elsewhere in the same document, the very same entity won't display as a bullet. Oh, and I tried pasting in a straight bullet (hence saving as utf) - no go. I get a different result for 149 versus 0149. Am I missing the point?

As an aside, I took the reference outside of an anchor tag, and it started functioning correctly. Haven't been able to fix the ndash issue though, which similarly has just started happening.
Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
JasonD
Global Moderator
Hero Member
*****
Posts: 546



View Profile Awards
« Reply #5 on: February 01, 2008, 10:37:11 PM »

If your editor cannot handle utf-8 use a better editor. And check you are saving as utf-8 and not other encodings or other flavours of unicode (eg utf-16, but that should be noticable).

You got 0149 from the keystroke to type a bullet on Windows, but you don't want that, you want the unicode point (which on W2k charmap is displayed in the bottom left).

Leading zeros should be ignored in entity numbers for #149 and #0149 should be the same, which is to say neither should display as a bullet, browsers that do show a bullet are emulating Microsoft. Linux Konqueror/3.5.8 does, Firefox/2.0.0.11 doesn't (it shows as a square with the code point [00 95] as it does for any other non-character).

All browsers I am aware of will show #8226 (or named bull) or a correctly encoded document as a bullet.
Logged
samhs
Administrator
Hero Member
*****
Posts: 1711



View Profile WWW Awards
« Reply #6 on: February 01, 2008, 11:20:26 PM »

Thanks Jason. I hear what you're saying, but firefox *does* display it as a bullet, on mac and pc. As does Safari (webkit), IE6 & 7. I'll use your advice in future though smile
Logged

Loose adj a not held together; not fastened or firmly fixed in place
Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc.
---
Blog: www.ohwrite.co.uk
Twitter: www.twitter.com/samhs
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!