Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

charset=utf-8 to uppercase #11558

Closed
vnn456 opened this issue Apr 13, 2015 · 3 comments
Closed

charset=utf-8 to uppercase #11558

vnn456 opened this issue Apr 13, 2015 · 3 comments

Comments

@vnn456
Copy link

vnn456 commented Apr 13, 2015

Chrome automatically sends(PUT/POST) the charset in uppercase UTF-8. Firefox and IE don't.

Thanks

@pkozlowski-opensource
Copy link
Member

This sounds like a statement not a bug report... Are you suggesting that AngularJS has something to do with it? If so, please provide a minimal reproduce scenario as requested here: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#submitting-an-issue

@vnn456
Copy link
Author

vnn456 commented Apr 13, 2015

AngularJS Version: 1.3.15

Please see the line below from source:
var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};

I have read in many forums that uppercase 'UTF-8' is the de facto standard.

For now, I modified ng code to uppercase in my application. Thought it would be nice if you make changes on your end as well.

Because of lower case, my Struts2-REST plugin based application was not populating the model. So, PUT/POST methods didn't seem to work. I will be submitting a patch to Apache Struts to ignore case.

Thanks.

@pkozlowski-opensource
Copy link
Member

Well, looking through various discussions it seems like charset casing shouldn't matter: http://stackoverflow.com/questions/19391221/http-are-character-set-names-case-sensitive

Do you have a pointer to other docs / spec that would state otherwise? What do you mean by:

I have read in many forums that uppercase 'UTF-8' is the de facto standard.

Could you provide the source (ideally a spec?)

I'm going to close this one since from my quick reading it seems that charset should not be case-sensitive and default headers are configurable, which means that you can change $http configuration to suit your particular backend needs.

Happy to re-open / re-consider if you can point me to specs that state otherwise, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants