datopian / datapipes

Data Pipes for CSV
https://datapipes.okfnlabs.org/
MIT License
117 stars 16 forks source link

Replace %20s with nbsps in Chrome #100

Closed andylolz closed 10 years ago

andylolz commented 10 years ago

Chrome makes URLs with spaces illegible: chrome

We replace these %20s with non-breaking spaces (which look normal) and then parse them as if they were spaces.

Refs #87.

andylolz commented 10 years ago

This is really hacky! The browser check is there because I’ve no idea how this will behave across browsers. (Also because this breaks the tests (expecting 200, got 302) without updating them with non-breaking spaces, which I’d rather not do.)

rufuspollock commented 10 years ago

@andylolz i think we need to revert this change as it is a breaking one :-( e.g. this url which has a %20 in the url now breaks

http://www.biglotteryfund.org.uk/-/media/Files/Research%20Documents/aOpenDataFiles/BIGGrantOpenData2004_05.csv

http://datapipes.okfnlabs.org/csv/head/html?url=http://www.biglotteryfund.org.uk/-/media/Files/Research%20Documents/aOpenDataFiles/BIGGrantOpenData2004_05.csv

It breaks because your "breaking space" fixer now strips out %20 in url which is essential.

We can add a test ;-)

andylolz commented 10 years ago

Aha ok, that’s not too bad… I guess if we just leave URLs alone that should sort it.