Skip to content

Commit 94794dc

Browse files
committed
disable auto-detect USS encoding for now
Signed-off-by: Trae Yelovich <[email protected]>
1 parent 7fdcf6b commit 94794dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

native/c/zusf.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ int zusf_read_from_uss_file(ZUSF *zusf, string file, string &response)
172172
in.close();
173173

174174
char tagged_encoding[16] = {0};
175-
ssize_t xattr_result = getxattr(file.c_str(), "system.filetag", &zusf->encoding);
175+
// ssize_t xattr_result = getxattr(file.c_str(), "system.filetag", &zusf->encoding);
176176

177177
const bool encodingProvided = strlen(zusf->encoding) > 0;
178178

179179
char *bufEnd;
180-
if (encodingProvided || xattr_result > 0 && strlen(tagged_encoding) > 0 /* && (*encoding != "IBM-1047" && *encoding != "01047") */)
180+
if (encodingProvided /* && (*encoding != "IBM-1047" && *encoding != "01047") */)
181181
{
182-
const encoding = encodingProvided ? string(zusf->encoding) : string(tagged_encoding);
183-
char *outBuf = zut_encode_alloc(rawData, size, encoding, zds->diag, &bufEnd);
182+
// const encoding = encodingProvided ? string(zusf->encoding) : string(tagged_encoding);
183+
char *outBuf = zut_encode_alloc(rawData, size, string(zusf->encoding), zusf->diag, &bufEnd);
184184
if (outBuf)
185185
{
186186
response.clear();
@@ -217,7 +217,7 @@ int zds_write_to_uss_file(ZUSF *zusf, string file, string &data)
217217
if (strlen(zusf->encoding) > 0)
218218
{
219219
char *bufEnd;
220-
char *outBuf = zut_encode_alloc(data.c_str(), data.length(), string(zusf->encoding), zusf->diag, &bufEnd);
220+
char *outBuf = zut_encode_alloc((char *)data.c_str(), data.length(), string(zusf->encoding), zusf->diag, &bufEnd);
221221
if (outBuf)
222222
{
223223
data.clear();

0 commit comments

Comments
 (0)