Skip to contentSkip to conversation

iconv: additional encodings

Buildroot Jan Pohanka 4 participants 9 messages Oct 31, 2013 – Nov 1, 2013

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm using buildroot for creating a filesystem on armhf target. Target is selected as external and it is Linaro 2013.04. iconv is a part of glibc in such configuration as far as I know. I have also selected "Copy GCONV libraries to target" option and "Generate locale data" for cs_CZ.CP1250 cs_CZ.UTF-8 cs_CZ.ISO-8859-2 - I'm interested mainly in these encodings.

Unfortunately in such case iconv -l still shows only a few basic encodings but ISO-8859-2 nor CP1250 are present. (CP1250.so and ISO8859-2.so exists in /usr/lib/gconv)

Is it possible to add required encodings iconv support somehow, please?

with best regards
Jan

#1 lore raw

I will answer myself: GCONV_PATH variable is the solution. It must point into /usr/lib/gconv!

2013/10/31 Jan Pohanka <[email protected]>:

Quoted 16 lines

Hi all,

I'm using buildroot for creating a filesystem on armhf target. Target is selected as external and it is Linaro 2013.04. iconv is a part of glibc in such configuration as far as I know. I have also selected "Copy GCONV libraries to target" option and "Generate locale data" for cs_CZ.CP1250 cs_CZ.UTF-8 cs_CZ.ISO-8859-2 - I'm interested mainly in these encodings.

Unfortunately in such case iconv -l still shows only a few basic encodings but ISO-8859-2 nor CP1250 are present. (CP1250.so and ISO8859-2.so exists in /usr/lib/gconv)

Is it possible to add required encodings iconv support somehow, please?

with best regards
Jan

#2 lore raw

Hi Jan,

Quoted 2 lines · Jan Pohanka

I will answer myself: GCONV_PATH variable is the solution. It must point into /usr/lib/gconv!

If you are talking about the host /usr then I think this is not correct. Buildroot should not depend on such files from the host.

Can you find the right files inside output/host ? The files coming from the external toolchain are in output/host/opt.

Best regards,
Thomas

#3 lore raw

Dne 31.10.2013 21:38, Thomas De Schampheleire napsal(a):

Quoted 10 lines

Hi Jan,

Quoted 2 lines · Jan Pohanka

I will answer myself: GCONV_PATH variable is the solution. It must point into /usr/lib/gconv!

If you are talking about the host /usr then I think this is not correct. Buildroot should not depend on such files from the host.

Can you find the right files inside output/host ? The files coming from the external toolchain are in output/host/opt.

Hi Thomas,

I have realized that external toolchain support is a bit patched in the fork that I'm using compared to original one. There is an option to copy files gconv-modules, gconv-modules.cache, CP1250.so, and all other encodings shared libraries to target/usr/lib/gconv directory. I thought that it is a standard directory which the glibc iconv implementation would search shared encodings for. This is not truth because GCONV_PATH has to be set and point there, to make iconv work with all encodings.

Maybe something similar could be added to standard Buildroot. It took me a day to realize where is the problem.

with best regards
Jan

#4 lore raw

Dear Jan Pohanka,

Quoted 10 lines · Jan Pohanka

I have realized that external toolchain support is a bit patched in the fork that I'm using compared to original one. There is an option to copy files gconv-modules, gconv-modules.cache, CP1250.so, and all other encodings shared libraries to target/usr/lib/gconv directory. I thought that it is a standard directory which the glibc iconv implementation would search shared encodings for. This is not truth because GCONV_PATH has to be set and point there, to make iconv work with all encodings.

Maybe something similar could be added to standard Buildroot. It took me a day to realize where is the problem.

Do you think you could send a patch to implement this in Buildroot?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw
Quoted 1 line

Do you think you could send a patch to implement this in Buildroot?

Hi Thomas,

I will prepare a patch with this feature. Can you please confirm whether /etc/environment file can be used to set variables for whole system in Busybox? Or it is better to use eg. profile file, etc.

thanks
Jan

2013/11/1 Thomas Petazzoni <[email protected]>:

Quoted 24 lines

Dear Jan Pohanka,

Quoted 10 lines · Jan Pohanka

I have realized that external toolchain support is a bit patched in the fork that I'm using compared to original one. There is an option to copy files gconv-modules, gconv-modules.cache, CP1250.so, and all other encodings shared libraries to target/usr/lib/gconv directory. I thought that it is a standard directory which the glibc iconv implementation would search shared encodings for. This is not truth because GCONV_PATH has to be set and point there, to make iconv work with all encodings.

Maybe something similar could be added to standard Buildroot. It took me a day to realize where is the problem.

Do you think you could send a patch to implement this in Buildroot?

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#6 lore raw

Dear Jan Pohanka,

Quoted 3 lines · Jan Pohanka

I will prepare a patch with this feature. Can you please confirm whether /etc/environment file can be used to set variables for whole system in Busybox? Or it is better to use eg. profile file, etc.

Why is setting an environment variable necessary? Isn't glibc always looking for gconv modules in a standard place, in which we could install those modules?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

Hi Thomas,

I believe Jan is talking about my patch:

https://github.com/Stane1983/buildroot-mx/
commit/8be22b0db136403ee55c84bf093366808d65dc3f

It works for Linaro toolchains.

In this patch I had to export GCONV_PATH because of XBMC. Otherwise, XBMC is not aware of gconv libs existence.

Quoted 13 lines · Thomas Petazzoni

Dear Jan Pohanka,

Quoted 3 lines · Jan Pohanka

I will prepare a patch with this feature. Can you please confirm whether /etc/environment file can be used to set variables for whole system in Busybox? Or it is better to use eg. profile file, etc.

Why is setting an environment variable necessary? Isn't glibc always looking for gconv modules in a standard place, in which we could install those modules?

Thomas