Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: rullolex on March 09, 2021, 05:06:50 PM

Title: locale not supported by C library
Post by: rullolex on March 09, 2021, 05:06:50 PM
hi,
I try to locale mtpaint but I have this:

gdk-warning **:22:54:12.447: locale not supported by C library

how can I resolve this error?

I have installed getlocale.tcz and run it.
Title: Re: locale not supported by C library
Post by: rullolex on March 10, 2021, 01:39:12 PM
Could the problem is this?

Code: [Select]
mylocale.tcz is smaller than 10KBI check the folder and is empty

thank you
Title: Re: locale not supported by C library
Post by: Juanito on March 11, 2021, 01:45:19 AM
Did you check that the getlocale extension and all of its dependencies were loaded before running the script to create mylocale:
Code: [Select]
getlocale.tcz
   glibc_gconv.tcz
   glibc_i18n_locale.tcz
   glibc_apps.tcz
   dialog.tcz
      ncursesw.tcz
   squashfs-tools.tcz
      liblzma.tcz
      lzo.tcz
      libzstd.tcz

You would need the locale files produced when compiling mtpaint to see a different locale in the mtpaint menus.
Title: Re: locale not supported by C library
Post by: rullolex on March 11, 2021, 10:10:25 AM
Hi Juanito,

I check and I have all dependance loaded but I have the same error.

About mtpaint, I have recompiled it again with the locale specification in the ./configure and I have reinstalled it.

I have the:
gdk-warning, locale not supported by C library
gtk-warning, locale not supported by C library
if language on boot is it,

if I set lang=C I have only the gdk-warning error

Ps.: mtpaint work I had only the warning
Title: Re: locale not supported by C library
Post by: rullolex on March 11, 2021, 01:02:06 PM
hi Junito,

I can't modify the previous post

I do some test:

1. "it" on boot and "it" in mtpaint:

gdk-warning, locale not supported by C library
gtk-warning, locale not supported by C library

2. "C£ on boot and "it" in mtpaint:
gdk-warning error

3. "C" on boot and "defoult language" on mtpaint
no error
Title: Re: locale not supported by C library
Post by: rullolex on March 13, 2021, 02:24:27 AM
Hi Juanito,

it is the locale out put it can be helpfull?

Code: [Select]
tc@box:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=it_IT
LC_CTYPE="it_IT"
LC_NUMERIC="it_IT"
LC_TIME="it_IT"
LC_COLLATE="it_IT"
LC_MONETARY="it_IT"
LC_MESSAGES="it_IT"
LC_PAPER="it_IT"
LC_NAME="it_IT"
LC_ADDRESS="it_IT"
LC_TELEPHONE="it_IT"
LC_MEASUREMENT="it_IT"
LC_IDENTIFICATION="it_IT"
LC_ALL=
/code]
Title: Re: locale not supported by C library
Post by: Juanito on March 13, 2021, 02:55:24 AM
If I try in CorePure64-12.x, I get this:
Code: [Select]
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
..with lang=en_US.UTF-8
Title: Re: locale not supported by C library
Post by: rullolex on March 13, 2021, 03:13:48 AM
if I set lang=C I do not have errors

Code: [Select]
tc@box:~$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
Title: Re: locale not supported by C library
Post by: polikuo on March 13, 2021, 06:42:46 AM
Judging by the screenshot you provided, the extension is broken.

You should reboot the system without backup, preferably with boot code base norestore.

Check if your tcedir is correct, if not, run tce-setdrive.
Code: [Select]
realpath /etc/sysconfig/tcedir
Remove the archive if it exist.
Code: [Select]
sudo rm -f /usr/lib/locale/locale-archive
Load getlocale and retry.
Code: [Select]
tce-load -i getlocale
sudo getlocale.sh
Title: Re: locale not supported by C library
Post by: rullolex on March 13, 2021, 11:21:51 AM
Hi polikuo,

i try but not work.

if I run
Code: [Select]
realpath /etc/sysconfig/tcedir
I had

Code: [Select]
/mnt/sda1/tce
that is correct I think.

thank you

Title: Re: locale not supported by C library
Post by: polikuo on March 14, 2021, 09:21:01 AM
Would it work if you specify the charset for your locale ?
Code: [Select]
export LC_ALL='it_IT.utf8'
As for the archive, maybe you could try creating one manually ?
Code: [Select]
sudo rm -f /usr/lib/locale/locale-archive
sudo localedef -i it_IT -c -f UTF-8 it_IT.UTF-8
Title: Re: locale not supported by C library
Post by: rullolex on March 14, 2021, 02:36:07 PM
Hi polikuo,

thank you for your answer, i will try.

I will ask in the forum if someone would test mtpaint-locale that I build, while I try to fix my locale
Title: Re: locale not supported by C library
Post by: rullolex on March 17, 2021, 02:05:21 PM
Hi polikuo,

works :)

I reinstall getlocale and run

Code: [Select]
sudo localedef -i it_IT -c -f UTF-8 it_IT.UTF-8
now it works.

Thank you very much
Title: Re: locale not supported by C library
Post by: polikuo on March 17, 2021, 11:09:54 PM
Good.

You could either add the archive to your /opt/.filetool.lst for filetool backup

Or you could create an extension with squashfs-tools.tcz
Title: Re: locale not supported by C library
Post by: rullolex on March 18, 2021, 06:21:44 AM
Hi Polikuo

I have add the folder /usr/lib/locale to the backup by the tool, I think it is the same think than edit the file  /opt/.filetool.lst

I will do the extension with squashfs-tools.tcz for exercise
Title: Re: locale not supported by C library
Post by: rullolex on March 24, 2021, 03:38:17 PM
Hi,
i have made a big mistake, i have put norestore in the boot loader and I have loose the locale-archive, i made the extention and i named it it-locale but do not work, i have to name the extention mylocale? Or i do a mistake in made it.
Thank you.

PS fortunately i have a backup of the file locale-archive  :D
Title: Re: locale not supported by C library
Post by: polikuo on March 24, 2021, 10:55:35 PM
The name doesn't matter.

Did you add the renamed tcz into your onboot.lst ?

They have to be consistent you know.

BTW, you'll need to regenerate it whenever TC move on to a new release.

Hi,
i have made a big mistake, i have put norestore in the boot loader and I have loose the locale-archive, i made the extention and i named it it-locale but do not work, i have to name the extention mylocale? Or i do a mistake in made it.
Thank you.

PS fortunately i have a backup of the file locale-archive  :D

What's the output if you type this ?
Code: [Select]
unsquashfs -l it-locale.tcz
Title: Re: locale not supported by C library
Post by: rullolex on March 25, 2021, 01:23:40 PM
Hi Polikuo,

yes, it-locale.tcz is on boot.

here the outupt of the command,

Code: [Select]
tc@box:/mnt/sda1/tce/optional$ unsquashfs -l it-locale.tcz
Parallel unsquashfs: Using 2 processors
1 inodes (743 blocks) to write

squashfs-root
squashfs-root/locale-archive

thank you
Title: Re: locale not supported by C library
Post by: polikuo on March 25, 2021, 02:05:05 PM
http://forum.tinycorelinux.net/index.php/topic,24857.15.html
here the outupt of the command

OK, I see the problem here.

This is how it should look like.

Code: [Select]
$ unsquashfs -l mylocale.tcz
Parallel unsquashfs: Using 16 processors
1 inodes (974 blocks) to write

squashfs-root
squashfs-root/usr
squashfs-root/usr/lib
squashfs-root/usr/lib/locale
squashfs-root/usr/lib/locale/locale-archive

To make it right:
1. Unpack
2. Make directories
3. Repack

Simple enough.

Replace it-locale.tcz with the repacked one.
Don't forget to add a dep file:
Code: [Select]
echo glibc_gconv.tcz > it-locale.tcz.dep
P.S.
Sorry, I couldn't post the exact commands for the job
The server internal error is so wonderful :P
Title: Re: locale not supported by C library
Post by: rullolex on March 25, 2021, 05:45:22 PM
Hi Polikuo,

Done, it works, now I have norestore and the localization.

Sometime it is bettere to have only the indication and learn ;)

if I have understand good, if I move from TC 12 to for expample 12.1, I have to do again the locale-archive it is correct?

I can share the it-locale.tcz for other italian users that have the getlocale problem as me? It would works?

thank you
Title: Re: locale not supported by C library
Post by: Rich on March 25, 2021, 07:54:47 PM
Hi rullolex
... if I have understand good, if I move from TC 12 to for expample 12.1, I have to do again the locale-archive it is correct? ...
No, you shouldn't need to do it again.
Title: Re: locale not supported by C library
Post by: polikuo on March 25, 2021, 11:12:06 PM
if I have understand good, if I move from TC 12 to for expample 12.1, I have to do again the locale-archive it is correct?

From my past experience, if the glibc version is different, some programs may not act correctly.

It may be locale specific, but they do cause some trouble.

That's why I always remake the extension when TC move on to a newer release.

In short:
For major release -> yes
For minor release -> no