It would be nice if the request/response body did not assume utf-8 strings#61
It would be nice if the request/response body did not assume utf-8 strings#61stephenc wants to merge 2 commits intoscribejava:masterfrom
Conversation
|
This implies changing quite a few public methods, and breaks backwards compatibility... As it is, I don't think we gain too much from this, there are people using scribe in China and Korea so the encoding stuff must be good enough. But, good enough is sometimes not enough and it's indeed something I'd like to include in Scribe :) I just don't want to break public methods yet (until 1.2 at least)... let me think about this for a while. Thank you very much for contributing! |
|
I think I managed to make the changes without affecting public methods ;-) only extending and adding additional methods to allow the byte[] to be accessed. |
|
ok getBodyContents() is public... I missed that... I'll update with a getBodyContentsAsByteArray() version |
|
Also StreamUtils#getStreamContents signature changed |
|
yes but that is only used in one place in your code. ;-) Again it could be worked around, but given that it's current behaviour is not symmetric with respect to the request's complete lack of charset specification, you could probably get away with changing it (as I suspect nobody would be relying on it) ;-) |
|
Once a method is public it cannot be changed unless it's a minor version (e.g. 1.2). I really don't know what people are doing with that public method, so I can't change it |
|
Closing |
The following hacky change does some work to allow access to the raw bytes as not every byte array can be converted into a valid utf-8 string