singlebrook / utf8-cleaner

MIT License
277 stars 44 forks source link

still getting 'invalid byte sequence in UTF-8' #2

Closed jontyD closed 11 years ago

jontyD commented 11 years ago

somewhere in china is sending these values to our app causing the above error

messages/new?content=Please%2Bcall%2Bme%2Bback%2Bto%2Bdiscuss%E2%80%A6+Result:+chosen+nickname+%22iuggoutleti%22;+registered;+logged+in;+success+-+posted+to+first+encountered+partition+%22/messages/new?content=Please+call+me+back+to+discuss%E2%80%A6%22;+Result:+%D1%A1%D4%F1%D7%A2%B2%E1%D3%C3%BB%A7%C3%FB+%22scuncimmuch%22;+%D7%A2%B2%E1%CD%EA%B3%C9;+%B3%C9%B9%A6;

Should your gem resolve this?

I tried it but to no avail

sbleon commented 11 years ago

@jontyD, these are similar to the URLs we were seeing that prompted us to create the gem, so I'd say there's a good chance it will help you! It should be pretty easy to test by simply requesting the bad URL, seeing the 500 error, installing the gem, and trying again.

On Fri, May 10, 2013 at 11:09 AM, jontyD notifications@github.com wrote:

somewhere in china is sending these values to our app causing the above error

messages/new?content=Please%2Bcall%2Bme%2Bback%2Bto%2Bdiscuss%E2%80%A6+Result:+chosen+nickname+%22iuggoutleti%22;+registered;+logged+in;+success+-+posted+to+first+encountered+partition+%22/messages/new?content=Please+call+me+back+to+discuss%E2%80%A6%22;+Result:+%D1%A1%D4%F1%D7%A2%B2%E1%D3%C3%BB%A7%C3%FB+%22scuncimmuch%22;+%D7%A2%B2%E1%CD%EA%B3%C9;+%B3%C9%B9%A6;

Should your gem resolve this?

— Reply to this email directly or view it on GitHubhttps://github.com/singlebrook/utf8-cleaner/issues/2 .

jontyD commented 11 years ago

Thanks for the response, however the point that I failed to get across is that I have installed the gem, put the junk in my local version and got the error.

Any chance you can explain? I tried writing my own middleware for this and totally failed.

Jonty Davis Developer Transcendit Ltd.

    Jonathan Davis

Web Developer

http://www.transcendit.co.uk[cid:transcendit570f46]

            C10 Marquis Court

Team Valley, Gateshead NE11 0RU 0191 482 0444calto:0191%20482%20044 www.transcendit.co.ukhttp://www.transcendit.co.uk IT Support & Implementation Systems & Network Administration Application Development Web Design Cloud Computing & Hosting

[cid:partners9803a9]

Please help the environment: if possible do not print this email. Please note: All prices quoted exclude VAT. The information contained within this email is confidential. It may also be legally privileged. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this email. Such unauthorised use may be unlawful. If you have received this email in error, please inform us immediately at enquiries@transcendit.co.ukmailto:enquiries@transcendit.co.uk and delete it and all copies from your system. Transcendit Ltd is a Limited Company registered in England and Wales No.: 4041370. VAT No.: 747 2063 34

Disclaimer added by CodeTwo Exchange Rules 2010 www.codetwo.comhttp://www.codetwo.com/?sts=1048


From: sbleon [notifications@github.com] Sent: 13 May 2013 17:49 To: singlebrook/utf8-cleaner Cc: Jonathan Davis Subject: Re: [utf8-cleaner] still getting 'invalid byte sequence in UTF-8' (#2)

@jontyD, these are similar to the URLs we were seeing that prompted us to create the gem, so I'd say there's a good chance it will help you! It should be pretty easy to test by simply requesting the bad URL, seeing the 500 error, installing the gem, and trying again.

On Fri, May 10, 2013 at 11:09 AM, jontyD notifications@github.com wrote:

somewhere in china is sending these values to our app causing the above error

messages/new?content=Please%2Bcall%2Bme%2Bback%2Bto%2Bdiscuss%E2%80%A6+Result:+chosen+nickname+%22iuggoutleti%22;+registered;+logged+in;+success+-+posted+to+first+encountered+partition+%22/messages/new?content=Please+call+me+back+to+discuss%E2%80%A6%22;+Result:+%D1%A1%D4%F1%D7%A2%B2%E1%D3%C3%BB%A7%C3%FB+%22scuncimmuch%22;+%D7%A2%B2%E1%CD%EA%B3%C9;+%B3%C9%B9%A6;

Should your gem resolve this?

— Reply to this email directly or view it on GitHubhttps://github.com/singlebrook/utf8-cleaner/issues/2 .

— Reply to this email directly or view it on GitHubhttps://github.com/singlebrook/utf8-cleaner/issues/2#issuecomment-17824520.

sbleon commented 11 years ago

@jontyD, utf8-cleaner does prevent your query string from breaking my app in development mode. I assume you've got it in your Gemfile and you've run bundle install. Do you see it listed if you run bundle exec rake middleware?

I'm seeing mixed results in production. Running on Passenger on a cloud server, I seem to be protected. On Heroku, however, I'm still getting the errors. utf8-cleaner is at the top of the middleware stack in both cases, so I don't know why it's not working on Heroku.

jontyD commented 11 years ago

Thanks for your support.

I will try again on my local machine - I thought I'd installed it correctly but worth trying again!

However we would want to use it on Heroku so that is another issue.

I'll let you know if I succeed locally.

Jonty Davis Developer Transcendit Ltd.

    Jonathan Davis

Web Developer

http://www.transcendit.co.uk[cid:transcenditdb26d9]

            C10 Marquis Court

Team Valley, Gateshead NE11 0RU 0191 482 0444calto:0191%20482%20044 www.transcendit.co.ukhttp://www.transcendit.co.uk IT Support & Implementation Systems & Network Administration Application Development Web Design Cloud Computing & Hosting

[cid:partners2cd782]

Please help the environment: if possible do not print this email. Please note: All prices quoted exclude VAT. The information contained within this email is confidential. It may also be legally privileged. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this email. Such unauthorised use may be unlawful. If you have received this email in error, please inform us immediately at enquiries@transcendit.co.ukmailto:enquiries@transcendit.co.uk and delete it and all copies from your system. Transcendit Ltd is a Limited Company registered in England and Wales No.: 4041370. VAT No.: 747 2063 34

Disclaimer added by CodeTwo Exchange Rules 2010 www.codetwo.comhttp://www.codetwo.com/?sts=1048


From: sbleon [notifications@github.com] Sent: 21 May 2013 15:49 To: singlebrook/utf8-cleaner Cc: Jonathan Davis Subject: Re: [utf8-cleaner] still getting 'invalid byte sequence in UTF-8' (#2)

@jontyD, utf8-cleaner does prevent your query string from breaking my app in development mode. I assume you've got it in your Gemfile and you've run bundle install. Do you see it listed if you run bundle exec rake middleware?

I'm seeing mixed results in production. Running on Passenger on a cloud server, I seem to be protected. On Heroku, however, I'm still getting the errors. utf8-cleaner is at the top of the middleware stack in both cases, so I don't know why it's not working on Heroku.

— Reply to this email directly or view it on GitHubhttps://github.com/singlebrook/utf8-cleaner/issues/2#issuecomment-18213690.

sbleon commented 11 years ago

@jontyD did you get the utf8-cleaner gem working?

jontyD commented 11 years ago

No sorry, not not on heroku. Haven't tried for while though