0

I had a board based on buildroot with the support for libiconv.so. I used this library to develop a module, running on this board, that needs to convert strings between different encondings (UTF-8, UTF-16BE, CP850,...). By evolving the development of the board, I introduced the BR2_ENABLE_LOCALE in buildroot and this forced me to remove the support of the libiconv.so, which, hence, is no more present in the file system (see this post for details). After doing this, of course my module did not work anymore, in particular, it compiles properly, but when calling the function iconv_open(), it always returns an "Invalid argument" error. The commit message in the link I posted, states that with BR2_ENABLE_LOCALE activated, the libiconv.so is not necessary anymore, so my question is: how can I convert my strings now?

bui3
  • 123
  • 11
  • Which C run-time library implementation are you using including its version? – Ian Abbott Jul 28 '23 at 14:18
  • Thank you for reply. The operating system is Linux, it's not fully clear to me what do you mean with "C run-time library implementation"... maybe glib? – bui3 Jul 28 '23 at 14:27
  • I mean something like glibc, uClibc, uClibc-ng, or musl libc. It will be part of the cross-compilation toolchain. – Ian Abbott Jul 28 '23 at 14:46
  • GLIBC_VERSION = 2.36-81 I'm trying to use g_iconv_open("UTF-16BE", "UTF-8") which fails and set the error to No such file or directory – bui3 Jul 28 '23 at 15:03
  • 1
    Glibc uses external gconv module files, but there should be a set of standard system gconv modules installed along with the C library. I think you can control whether the modules get installed and which modules to install with `BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY` and `BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST`. The full set is ~8MiB on ARM, so you may want to select a smaller list of modules if space is tight. – Ian Abbott Jul 28 '23 at 16:32
  • Thank you so much, this definitely solved my problem! If you want to write it as answer, I will accept it – bui3 Jul 31 '23 at 13:42

0 Answers0