ryrych / rcarousel

yet another jQuery UI carousel
http://ryrych.github.com/rcarousel/
172 stars 48 forks source link

Strange space character is producing error in IE #52

Closed justin-arvay closed 10 years ago

justin-arvay commented 11 years ago

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.4; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) Timestamp: Wed, 10 Oct 2012 18:53:13 UTC

Message: Expected ')'

Using kdiff (or any program that shows all file characters) there is a random space character showing: Â

example line:

// create wrapper inside root element; this is needed for animating $root .addClass( "ui-carousel" ) .children() .wrapAll( "

" );

Removing all these characters fixes the IE error. Not sure how or why these characters are getting put in the file. Most of my text editors see those characters are blank spaces.

Note downloading a fresh copy of 1.1.3, and opening the unminified file inside win-zip allow shows these characters.

grantcurrey commented 11 years ago

I have the same issue in the current git hub clone. I got around it by just opening it in sublime text and selecting one of those characters, and doing a find and replace.

ryrych commented 11 years ago

Your browser probably has problems with UTF-8 encoding.

ConcreteGannet commented 10 years ago

I too have encountered this problem and spent way too long diagnosing and fixing it.

@ryrych , it's not a browser bug. Rather, it becomes a problem when a web server delivers content with a one byte charset like ISO-8859-1 instead of UTF-8. That is not always under a developer's control.

Your jquery.ui.rcarousel.js contains UTF-8 non-breaking space characters: the byte sequence C2 A0. In other words, your Javascript source code assumes UTF-8, and will only work if a web server says it's delivering UTF-8. There is no need for that. If you replace those with a plain space, it will work for a wider audience.

Please clean up your file. It will take five minutes.

ryrych commented 10 years ago

Thanks for taking your time. It shouldn't have taken me so long to fix this.