Skip to content

test_iconv.lua fails on termux due to missing hyphens #23

Description

@xiconet

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.

Activity

  1. changed the title [-]test_iconv.lua fails due to missing hyohens[/-] [+]test_iconv.lua fails due to missing hyphens[/+] on Sep 15, 2026
  2. changed the title [-]test_iconv.lua fails due to missing hyphens[/-] [+]test_iconv.lua fails on termux due to missing hyphens[/+] on Sep 15, 2026
  3. Tieske commented on Sep 15, 2026

    @Tieske
    Member

    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.

  4. Tieske commented on Sep 16, 2026

    @Tieske
    Member

    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.

  5. xiconet commented on Sep 16, 2026

    @xiconet
    Author

    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 ?
    

    termux iconv fails in a similar way, e.g.

    iconv -f utf8 -t utf-8 fp.utf8.txt
    iconv: conversion from utf8 unsupported
    

    but it will succeed when replacing utf8 by utf-8

    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?

  6. Tieske commented on Sep 16, 2026

    @Tieske
    Member

    Afaik they are hard coded in the iconv library.

  7. xiconet commented on Sep 16, 2026

    @xiconet
    Author

    Muito obrigado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions