Comments (14)
I am having a look.
from curl.
I have written three extra unit tests to cover the encoding parsing :
@Test
public void theSkyIsBlueInIvritWithTheWrongEncoding() throws IOException {
HttpResponse response = this.curl("-k -E src/test/resources/clients/libe/libe.pem https://localhost:%d/public/ -H 'Content-Type: text/plain; charset=ISO-8859-1' -d \"השמים כחולים\"");
Assertions.assertThat(IOUtils.toString(response.getEntity().getContent(), "utf-8")).contains("'????? ??????'");
}
@Test
public void theSkyIsBlueInIvritWithoutEncoding() throws IOException {
HttpResponse response = this.curl("-k -E src/test/resources/clients/libe/libe.pem https://localhost:%d/public/ -d \"השמים כחולים\"");
Assertions.assertThat(IOUtils.toString(response.getEntity().getContent(), "utf-8")).contains("'השמים כחולים'");
}
@Test
public void theSkyIsBlueInIvritWithUTF8Encoding() throws IOException {
HttpResponse response = this.curl("-k -E src/test/resources/clients/libe/libe.pem https://localhost:%d/public/ -H 'Content-Type: text/plain; charset=UTF-8' -d \"השמים כחולים\"");
Assertions.assertThat(IOUtils.toString(response.getEntity().getContent(), "utf-8")).contains("'השמים כחולים'");
}
It can now encode a payload using the correct encoding from the Content-Type header.
from curl.
will be the content of 0.0.17
from curl.
0.0.17 is currently staging, should be shipped in a couple of hours.
from curl.
in version 0.0.17 still has the problem :(
from curl.
you can use this link for test
https://api.bot-dev.org/danestani/
from curl.
Ok, thanks, you mean read data, and not post data.
from curl.
Yes
from curl.
I am sorry, I am not able to reproduce that error.
from curl.
$("https://api.bot-dev.org/danestani/")
=
curl https://api.bot-dev.org/danestani/
from curl.
it work for me in Intellij
but when i compile to jar file not work !
other persian chars show but when i use curl it change text to this
آیا میدانستید تمامی پستانداران به استثنای انسان و میمون کور رنگ میباشند؟
from curl.
and only persian chars not show
i dont have problem with English
from curl.
Ok. I will give it a try later.
from curl.
I was able to test that issue :
Unfortunately it does not seem to be related to the lib itself, because the problem is caused by a bad display of the text.
When opened in a text editor, I can see that :
The characters are not lost when saved in a new file.
Then,
- Are there additional steps after retrieving the output ? Please check that you always read the input streams using the UTF-8 encoding, and that you always get the bytes from the string with the UTF-8 encoding too.
- You will have to check your
<meta charset="UTF-8">
if you are using the lib from a webapp, - or you will have to debug your android app if you are trying to display the text inside a TextInput. Is it correctly rendered from the activity / fragment (use the intelliJ debugger) ?
Sorry I don't have a clue.
from curl.
Related Issues (20)
- way to get the response HOT 2
- StackOverflowError on POST with large json data HOT 4
- stackoverflowErorr for long curl, where we are calling `getArgsFromCommand()` HOT 1
- Argument -L doesn't work HOT 6
- add option for keystore password HOT 7
- Some Assistance re: Curl Parameters. HOT 2
- use dataurlencode HOT 4
- -k parameter for unsupported TLS algorithms does not work HOT 7
- Can not upload a file HOT 6
- Upload base64 file stack overflow error HOT 4
- Streaming HOT 2
- sends two user-agent HOT 3
- Error: Invalid character found in method name [0x160x030x010x.....E0xe90x05I0x1c0x1e ]. HTTP method names must be tokens HOT 3
- --data-raw can not support HOT 4
- java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64 HOT 2
- Some help please. HOT 10
- sftp curl example HOT 1
- -T parameter support missing HOT 1
- proxy bug HOT 1
- ReadArguments OutOfMemoryError bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl.