Skip to content

Commit 52625b4

Browse files
authored
[ISSUE-35] Submit post parameters using UTF-8 charset (#37)
1 parent 11f786e commit 52625b4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
44

55
## 1.1.0 (UNRELEASED)
66

7+
#### Bugfixes
8+
- [Issue-35](https://github.com/Crim/pardot-java-client/issues/35) Submit POST parameters using UTF-8 charset by default.
9+
710
#### Internal Dependency Updates
811
- org.apache.httpcomponents:httpclent from 4.5.6 to 4.5.10
912
- org.apache.logging.log4j from 2.11.0 to 2.12.1

src/main/java/com/darksci/pardot/api/rest/HttpClientRestClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
import javax.net.ssl.SSLContext;
4444
import java.io.IOException;
45+
import java.nio.charset.Charset;
46+
import java.nio.charset.StandardCharsets;
4547
import java.util.ArrayList;
4648
import java.util.List;
4749
import java.util.Map;
@@ -196,7 +198,7 @@ private <T> T submitRequest(final String url, Map<String, String> postParams, fi
196198
for (Map.Entry<String, String> entry : postParams.entrySet()) {
197199
params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
198200
}
199-
post.setEntity(new UrlEncodedFormEntity(params));
201+
post.setEntity(new UrlEncodedFormEntity(params, StandardCharsets.UTF_8));
200202

201203
logger.info("Executing request {} with {}", post.getRequestLine(), filterSensitiveParams(params));
202204

0 commit comments

Comments
 (0)