You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_iconv.lua fails on termux due to missing hyphens #23
I'm opening this as a separate issue, since although it's also on android/termux it's not directly related to the previously reported one regarding linking [see #20].
The provided test_iconv.lua works as exoected on my linux mint system, but on termux conversions to utf8 and utf16 fail, and they also fail when using iconv directly. This is because the termux iconv only understands utf-8 or utf-16. In other words, an hyphen is needed.
Not sure this is an issue with this library. Seems that this lib doesn't define the names, they are handled by the underlying iconv lib.
If you mean to only update the test, to support both, then that should be possible I think. Simply try, and on failure rettry with the alternative first before failing the test.
Looking at the tests; there's plenty of "utf-8" (which is the official name), and there's only 1 "utf8" and "utf16", so looks to me those two are explicitly there to test those aliases. Which termux apparently doesn't support.
I agree, this is not really an issue with the library itself.
Testing conversion from utf8 to utf-8
lua: test_iconv.lua:98: Failed to create a converter. object: Invalid input.
stack traceback:
[C]: in function 'assert'
test_iconv.lua:98: in local 'check_one'
test_iconv.lua:108: in main chunk
[C]: in ?
Updating the test is indeed a good idea. Since I'm far from being a lua expert, I'm currently studying how to do so.
BTW, do you know how these aliases are set on a linux system?
Activity
[-]test_iconv.lua fails due to missing hyohens[/-][+]test_iconv.lua fails due to missing hyphens[/+][-]test_iconv.lua fails due to missing hyphens[/-][+]test_iconv.lua fails on termux due to missing hyphens[/+]Tieske commentedon Sep 15, 2026
Not sure this is an issue with this library. Seems that this lib doesn't define the names, they are handled by the underlying iconv lib.
If you mean to only update the test, to support both, then that should be possible I think. Simply try, and on failure rettry with the alternative first before failing the test.
Tieske commentedon Sep 16, 2026
Can you provide a stacktrace?
Looking at the tests; there's plenty of "utf-8" (which is the official name), and there's only 1 "utf8" and "utf16", so looks to me those two are explicitly there to test those aliases. Which termux apparently doesn't support.
xiconet commentedon Sep 16, 2026
I agree, this is not really an issue with the library itself.
termux iconv fails in a similar way, e.g.
but it will succeed when replacing
utf8byutf-8Updating the test is indeed a good idea. Since I'm far from being a lua expert, I'm currently studying how to do so.
BTW, do you know how these aliases are set on a linux system?
Tieske commentedon Sep 16, 2026
Afaik they are hard coded in the iconv library.
xiconet commentedon Sep 16, 2026
Muito obrigado.