mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 15:12:22 +08:00
fix charset to utf-8
This commit is contained in:
parent
39c7065526
commit
9e9fd10b44
@ -168,7 +168,7 @@ public class StarRocksStreamLoadVisitor {
|
||||
|
||||
private String getBasicAuthHeader(String username, String password) {
|
||||
String auth = username + ":" + password;
|
||||
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes());
|
||||
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8));
|
||||
return new StringBuilder("Basic ").append(new String(encodedAuth)).toString();
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@ -38,7 +39,7 @@ public class StarRocksWriterManager {
|
||||
try {
|
||||
buffer.add(record);
|
||||
batchCount++;
|
||||
batchSize += record.getBytes().length;
|
||||
batchSize += record.getBytes(StandardCharsets.UTF_8).length;
|
||||
if (batchCount >= writerOptions.getBatchRows() || batchSize >= writerOptions.getBatchSize()) {
|
||||
String label = createBatchLabel();
|
||||
LOG.debug(String.format("StarRocks buffer Sinking triggered: rows[%d] label[%s].", batchCount, label));
|
||||
|
Loading…
Reference in New Issue
Block a user