Project-MONAI / MONAILabel

MONAI Label is an intelligent open source image labeling and learning tool.
https://docs.monai.io/projects/label
Apache License 2.0
565 stars 185 forks source link

Fix response encoding to explicitly use UTF-8 for HTTP response data #1672

Closed hubutui closed 2 months ago

hubutui commented 2 months ago

Previously, the code used response.getBytes() which might rely on the platform's default charset to encode the HTTP response data, leading to inconsistent behavior across platforms. This commit updates the code to use response.getBytes(StandardCharsets.UTF_8), specifying UTF-8 encoding explicitly for processing response data. This ensures cross-platform consistency and avoids potential encoding issues.