Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime-light/k2-platform/k2-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ inline constexpr size_t DEFAULT_MEMORY_ALIGN = 16;
} // namespace k2_impl_

inline constexpr int32_t errno_ok = 0;
inline constexpr int32_t errno_e2big = E2BIG;
inline constexpr int32_t errno_ebusy = EBUSY;
inline constexpr int32_t errno_enodev = ENODEV;
inline constexpr int32_t errno_einval = EINVAL;
Expand Down
5 changes: 3 additions & 2 deletions runtime-light/stdlib/system/system-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ Optional<string> f$iconv(const string& input_encoding, const string& output_enco
char* input_buf{const_cast<char*>(input_str.c_str())};
char* output_buf{output_str.buffer()};
size_t res{};
if (k2::iconv(std::addressof(res), cd, std::addressof(input_buf), std::addressof(input_len), std::addressof(output_buf), std::addressof(output_len)) ==
k2::errno_ok) {
if (auto iconv_result{
k2::iconv(std::addressof(res), cd, std::addressof(input_buf), std::addressof(input_len), std::addressof(output_buf), std::addressof(output_len))};
iconv_result != k2::errno_e2big) {
output_str.shrink(static_cast<string::size_type>(output_buf - output_str.c_str()));
return output_str;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpt/dl/475_convert_to_win.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@ok benchmark k2_skip
@ok benchmark
<?php
$str = "ìàìà ìûëà ðàìó!!! asfmklasdfasdgbsfbvdf buydfbdvbdfb vdfv dfv";

Expand Down
Loading