Skip to content
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

Response: set the content type to application/json #349

Merged
merged 1 commit into from
Apr 19, 2016

Conversation

jmoody
Copy link
Contributor

@jmoody jmoody commented Apr 15, 2016

Motivation

Some characters in an element's text/label show up as "?" UITest #879

Also set the charset to UTF-8.

@JonStoneman I think the only way to test this in UITest is to build a new CalabashBinding. Chris or I can show you how to generate the binding.

TODO

  • Needs test

ATTN: @sapieneptus We should check the response header in DeviceAgent.

@jmoody jmoody force-pushed the feature/set-the-content-type-of-response branch from a963a2f to a4da33e Compare April 19, 2016 14:43
@jmoody
Copy link
Contributor Author

jmoody commented Apr 19, 2016

Ready for review.

@jmoody jmoody changed the title WIP Response: set the content type to application/json Response: set the content type to application/json Apr 19, 2016
@sapieneptus
Copy link

I'd like to understand why UTF-8? Don't non-ascii languages like Japanese and Chinese rely on UTF-16? Is there an advantage to limiting the bits?

@jmoody
Copy link
Contributor Author

jmoody commented Apr 19, 2016

I think all Japanese and Chinese characters have a UTF-8 equivalent. That is to say, every character can be represented. In recent memory, I have interacted with one Japanese and one Chinese user around encodings - UTF-8 was good enough. With that said, I am not an encoding expert. I have had to deal with UTF 16 bit .strings files and wow, what a pain.

The problem with sending UTF-16 is that clients then need to consume UTF-16 which they probably don't by default. Ruby, for example, does not. There will probably come a time with UTF-16 is the right choice. I don't think it is today. Let's try to get out of the ASCII mud. :)

@sapieneptus
Copy link

I'm not really well versed on encodings, so I have to trust your judgement on that. I just would hate to use utf-8 if we knew it would cause problems for east-asian/middle eastern users, but if those character sets can be represented in utf-8 then it sounds like we should proceed with that.

@sapieneptus sapieneptus merged commit 1510a5e into develop Apr 19, 2016
@sapieneptus sapieneptus deleted the feature/set-the-content-type-of-response branch April 19, 2016 18:01
@@ -1,3 +1,7 @@
#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't miss having to write that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrate project to ARC so all new files are ARC by default #266

Pull requests welcome. :)

@jmoody jmoody mentioned this pull request May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants