aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/charset/iconv.cpp
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2023-03-31 10:54:08 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2023-03-31 12:28:07 +0300
commitfc1cffcfa7f0497a1f97b384a24bcbf23362f3be (patch)
treec15f7ab5b9e9b20fd0ef8fc07d598d28e8b32004 /library/cpp/charset/iconv.cpp
parent8a749596d40e91c896a1907afcd108d9221fbde1 (diff)
downloadydb-e9cbe5c5cf67db853d223fd365c9f05b695f7b96.tar.gz
Ydb stable 23-1-1923.1.19
x-stable-origin-commit: c5d5a396e89d0a72e0267a55e93d8404d4fb54fe
Diffstat (limited to 'library/cpp/charset/iconv.cpp')
-rw-r--r--library/cpp/charset/iconv.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/cpp/charset/iconv.cpp b/library/cpp/charset/iconv.cpp
index dc604c8492..0b6dbace9e 100644
--- a/library/cpp/charset/iconv.cpp
+++ b/library/cpp/charset/iconv.cpp
@@ -5,20 +5,22 @@
using namespace NICONVPrivate;
TDescriptor::TDescriptor(const char* from, const char* to)
- : Descriptor_(libiconv_open(to, from))
+ : Descriptor_(iconv_open(to, from))
, From_(from)
, To_(to)
{
+#if defined(USE_ICONV_EXTENSIONS)
if (!Invalid()) {
int temp = 1;
libiconvctl(Descriptor_, ICONV_SET_DISCARD_ILSEQ, &temp);
}
+#endif
}
TDescriptor::~TDescriptor() {
if (!Invalid()) {
- libiconv_close(Descriptor_);
+ iconv_close(Descriptor_);
}
}
@@ -31,7 +33,7 @@ size_t NICONVPrivate::RecodeImpl(const TDescriptor& descriptor, const char* in,
char* outPtr = out;
size_t inSizeMod = inSize;
size_t outSizeMod = outSize;
- size_t res = libiconv(descriptor.Get(), &inPtr, &inSizeMod, &outPtr, &outSizeMod);
+ size_t res = iconv(descriptor.Get(), &inPtr, &inSizeMod, &outPtr, &outSizeMod);
read = inSize - inSizeMod;
written = outSize - outSizeMod;