Skip to content

Commit e597d6d

Browse files
committed
Merge pull request #22 from witeX/issue/encoding_fix
Issue with sending non ANCII chars. They was encoded wrongly.
2 parents e582aac + 34464bb commit e597d6d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libs/sparkpost-lib/src/main/java/com/sparkpost/transport/RestConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ private void sendData(HttpURLConnection conn, String data) throws SparkPostExcep
184184
// Send data. At this point connection to server may not be established,
185185
// but writing data to it will trigger the connection.
186186
try (DataOutputStream wr = new DataOutputStream(conn.getOutputStream())) {
187-
188-
wr.writeBytes(data);
187+
wr.write(data.getBytes(DEFAULT_CHARSET));
189188
wr.flush();
190189
} catch (IOException ex) {
191190
throw new SparkPostException("Error sending request data:" + ex.toString());

0 commit comments

Comments
 (0)