aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/charset
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
parent8a749596d40e91c896a1907afcd108d9221fbde1 (diff)
downloadydb-fc1cffcfa7f0497a1f97b384a24bcbf23362f3be.tar.gz
Ydb stable 23-1-1923.1.19
x-stable-origin-commit: c5d5a396e89d0a72e0267a55e93d8404d4fb54fe
Diffstat (limited to 'library/cpp/charset')
-rw-r--r--library/cpp/charset/CMakeLists.darwin.txt2
-rw-r--r--library/cpp/charset/CMakeLists.linux-aarch64.txt2
-rw-r--r--library/cpp/charset/CMakeLists.linux.txt2
-rw-r--r--library/cpp/charset/iconv.cpp8
4 files changed, 5 insertions, 9 deletions
diff --git a/library/cpp/charset/CMakeLists.darwin.txt b/library/cpp/charset/CMakeLists.darwin.txt
index cb5c16891d..ed68dc36f8 100644
--- a/library/cpp/charset/CMakeLists.darwin.txt
+++ b/library/cpp/charset/CMakeLists.darwin.txt
@@ -6,13 +6,11 @@
# original buildsystem will not be accepted.
-find_package(Iconv REQUIRED)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-cxxsupp
yutil
- Iconv::Iconv
)
target_sources(library-cpp-charset PRIVATE
${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
diff --git a/library/cpp/charset/CMakeLists.linux-aarch64.txt b/library/cpp/charset/CMakeLists.linux-aarch64.txt
index 03b01e7c69..1d9903b843 100644
--- a/library/cpp/charset/CMakeLists.linux-aarch64.txt
+++ b/library/cpp/charset/CMakeLists.linux-aarch64.txt
@@ -6,14 +6,12 @@
# original buildsystem will not be accepted.
-find_package(Iconv REQUIRED)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
- Iconv::Iconv
)
target_sources(library-cpp-charset PRIVATE
${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
diff --git a/library/cpp/charset/CMakeLists.linux.txt b/library/cpp/charset/CMakeLists.linux.txt
index 03b01e7c69..1d9903b843 100644
--- a/library/cpp/charset/CMakeLists.linux.txt
+++ b/library/cpp/charset/CMakeLists.linux.txt
@@ -6,14 +6,12 @@
# original buildsystem will not be accepted.
-find_package(Iconv REQUIRED)
add_library(library-cpp-charset)
target_link_libraries(library-cpp-charset PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
- Iconv::Iconv
)
target_sources(library-cpp-charset PRIVATE
${CMAKE_SOURCE_DIR}/library/cpp/charset/generated/cp_data.cpp
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;