-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip non-ascii in QueryBuilder #362
Comments
Absolutely a PR on this would be valuable. Thanks. |
I'm not sure stripping makes sense. If you're searching for For reference here's an example error when searching for that:
|
Boy their Query API just doesn't seem to like UTF-8. I threw in a stackoverflow question incase anyone else has any ideas: http://stackoverflow.com/questions/42590136/query-quickbook-online-with-non-ascii-characters |
Yes good points. I have been thinking about this issue since it was first posted. One thought is that it might be a bad idea if the library changes data from underneath the user. Which could lead to unexpected results. For instance, if the user attempts to save a new Customer with a non-ascii character, say containing an umlaut or some other diacritic character and the gem sanitizes that by replacing I guess I'm learning towards the making the user make all the decisions themselves (thus, at a higher layer) and not doing any smartiness ourselves - just because it could lead to confusion. |
I agree that automatically doing something the user doesn't expect is a bad thing. However, if stripping UTF-8 is the only way to get a query through, it seems like every user is going to have to implement it themselves - so I think either an option (that defaults to off) or a utility method would be of a lot of value here. |
I submitted a question to Intuit's support and here's their response. I haven't had a chance to try it out yet:
|
Did a little testing. Looking at it more it seems like the example they chose works because it's an extended ASCII character. I asked for clarification on how to handle UTF-8 characters like |
I'd replied with:
And yesterday they finally got back to me:
So that's delightful. I've only been trying it with US companies. On one page in the docs that I can't seem to find again, I'd seen it say that they use encoding for US vs non-US companies. |
I've noticed that the Quickbooks API chokes on non-ascii characters - I was thinking it would be nice if the
QueryBuilder
either stripped those characters by default or contained some option to do that so I didn't have to manually do that everywhere I'm passing a string to the api.I'd be willing to contribute a PR if you think that would be valuable.
The text was updated successfully, but these errors were encountered: