To use ASCII codes in JavaScript specify \x99 where 99 is the hexadecimal value of the ASCII character. 153 decimal actually is 99 hex and so you would use:
str_txt = "\x99 A NOTIFICATION HAS BEEN SENT TO"
Of course since the code is over 127 you need to ensure that the page is using the correct charset. You might do better to use the unicode value for the character which can be specified as \u9999 where the again the 9999 is the hexadecimal value (I am not sure what character value it would be in unicode - you'd have to look it up).
Your code as posted displays jibberish in my IE9 for the chars at the start. They display correctly only when I add an appropriate character set in the <head>
Your code as posted displays jibberish in my IE9 for the chars at the start. They display correctly only when I add an appropriate character set in the <head>
I agree. That's exactly the problem that the OP is having and why neither of those posts will solve the problem.
Using the \x99 format might work but will possibly still be dependent on the encoding. The only way really guaranteed to work is to use \u9999 (substituting the appropriate hexadecimal unicode value for the 9999).
The value to use is \u00obb - that is the unicode value for the symbol in the string. So the line simply needs to read:
str_txt = "\u00bb A NOTIFICATION HAS BEEN SENT TO"
Your code as posted displays jibberish in my IE9 for the chars at the start. They display correctly only when I add an appropriate character set in the <head>
Quote:
Originally Posted by felgall
I agree. That's exactly the problem that the OP is having and why neither of those posts will solve the problem.
Using the \x99 format might work but will possibly still be dependent on the encoding. The only way really guaranteed to work is to use \u9999 (substituting the appropriate hexadecimal unicode value for the 9999).
The value to use is \u00obb - that is the unicode value for the symbol in the string. So the line simply needs to read:
str_txt = "\u00bb A NOTIFICATION HAS BEEN SENT TO"
Well if MSIE made a compatible browser that played well with others, it might not be a problem.
I avoid MSIE whenever possible, so I guess I start my postings from now on with the caveat of: "Tested in FF or Chrome only"!
Well if MSIE made a compatible browser that played well with others, it might not be a problem.
Personally I have no issue with IE but I understand why many people do, but that's a whole new can of bees wax .
But suffice to say, if building websites for the www, then regardless of what one might think of IE, there will be a very significant number of IE users for a quite a few years yet and so IE should be included in browser testing for websites.
Well if MSIE made a compatible browser that played well with others, it might not be a problem.
they have made two of them now. the slash escaping you showed was a quirk in the other browsers, not a standard. do you want it standard or to play well with others? ie10 supports more standards than opera 12.
I hate IE, but I don't consider 9 and 10 to be IE.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
no i used ">" or [SHIFT]+[.] ( > ) to make mine, no encoding or escaping needed.
if they look the same, well thanks, i thought so to.
Well that is using a totally different character - in fact you used two characters in place of the one that the OP was trying to use.
There are several characters that look like that > is the biggest of them, then there is one similar but about half the size and finally the one that looks like what tho OP wanted that has two of those smaller marks in the one character - the one with unicode \u00bb - which all browsers should be able to handle correctly.