WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to set language to latin1 in micro core  (Read 9447 times)

Offline flahaie

  • Newbie
  • *
  • Posts: 5
how to set language to latin1 in micro core
« on: August 16, 2011, 03:59:55 PM »
Hi everyone,
I use micro core v 3.8 and tn5250 to connect to an as400.
most of the forms on the 400 are in french but under micro core these characters are displayed as squares.
more over, when i try tn5250 on the same 400 but on tiny core with GUI the french characters are displayed properly.
I also have tried the same program under other distribution (ubuntu, debian) and it works properly.

I went through the documentation of tn5250 and it's written that most of the maps (we are using map 37) are converted to latin1.

so I want to know how can I change the language of the console of microcore to latin 1.

please help me.

thanks,

Offline floppy

  • Hero Member
  • *****
  • Posts: 577
Re: how to set language to latin1 in micro core
« Reply #1 on: September 06, 2011, 05:32:55 PM »
Hello,
since I dont see any response here (and I dont 100% understand the issue), perhaps you could use Xorg?
Just an idea..
AMD K6-IIIATZ 550MHz MB DFI K6xv3/+66
P4 HP DC7100 3GB 3GHz
Samsung NC10 boot from SD card port (via USB reader)
.. all TinyCore proofed

Offline flahaie

  • Newbie
  • *
  • Posts: 5
Re: how to set language to latin1 in micro core
« Reply #2 on: September 16, 2011, 04:41:06 PM »
Since the application is only a terminal, I don't really want to put xorg. I don't want to use mice in the (dirty) plant.
the operators are having enough difficulty with a keyboard, I don't want to add a mouse.

unless there's a way using xorg without a mouse?

more over I got little machines that only have 128 mb ram wt 200mhz cpu

and others with 512mb ram and 1ghz cpu

one last thing these are i586 not i686 cpu compatible

the cmov instruction is not supported if an application is compiled with cmov it crashes

thanks


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: how to set language to latin1 in micro core
« Reply #3 on: September 16, 2011, 05:26:01 PM »
I run TC on boxes with only a 486 class processor and 128M of RAM.
Check the wiki choosing the correct language.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: how to set language to latin1 in micro core
« Reply #4 on: September 17, 2011, 03:55:47 AM »
First up I have to state that I'm putting my toes here into a territory that I might not really understand, as for me the simple (7-bit) ASCII character set is sufficient. So I'm lacking any prior knowledge.

Having said that I wanted to see for myself what the difference in the character set between the console (which flahaie needs to get fixed) and a 'xterm' might be. For that purpose I created a little 'awk' script (also as an exercise in unfamiliar territory):
Code: (bash) [Select]
#!/bin/sh

# show printable characters: 0x20 to 0xFF

echo | awk ' {
  H = ""
  for (j = 0; j <= 15; j++) {
    H=H sprintf(" %02X ", j)
  }
  printf("\n\t%s\n", H)
  S = ""
  for (i = 32; i <= 256; i++) {
    if (length(S) == 0) {
      S=sprintf("0x%02X\t", (i / 16 ) * 16)
    }
    S=S sprintf(" %c  ", i)
    if ((i % 16) == 15) {
      printf("%s\n", S)
      S = ""
    }
  }
}'

When run in 'xterm' it showed for the range 0xA0 - 0xFF all sorts of characters and comparing it with this wikipedia page I concluded that it represents the 'latin-1' (AKA: IEC 8859-1) character set.

OTOH when run in a console window the entire range 0x80 - 0xFF showed up as solid little rectangles, and I guess this is what constitutes the reported problem. BTW, using the same little script in the console of a Arch Linux systems also shows the 'latin-1' characters, so indeed there might be something amiss in TC.

EDIT: I should have also mentioned that I'm now aware that (at least in theory) it should be possible to change the console font via
    'loadfont < /path/to/consolefont.psf'
but so far I had no luck with my limited attempts using some files from the most recent sources I could find (i.e. 'kbd-1.15.3.tar.bz2').
« Last Edit: September 17, 2011, 04:18:14 AM by maro »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11702
Re: how to set language to latin1 in micro core
« Reply #5 on: September 17, 2011, 12:14:46 PM »
I did a quick search on the Web, and there is a utility called   setfont   for setting the console
font out there.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: how to set language to latin1 in micro core
« Reply #6 on: September 17, 2011, 06:35:37 PM »
The 'setfont' utility is part of the 'kbd' package. As far as I can tell the BusyBox 'loadfont' applet fulfils the same purpose.

I have of course compiled said package and might be able to continue with my "poking around" today. One of the things I'll try to keep in mind is that there might be file format subtleties in play. As the "other side" of the 'kbd' package, which deals with keyboard maps (e.g. the 'loadkmaps' utility), has a BusyBox applet replacement that appears to use a non-default (binary) file format. Maybe something similar is in play here.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: how to set language to latin1 in micro core
« Reply #7 on: September 18, 2011, 07:59:23 AM »
YMMV, loadfont < lat0-16.psfu worked for me, got the euro symbol fine. It didn't map to one char properly though, the setfont util would be needed to set a mapping like that.
The only barriers that can stop you are the ones you create yourself.

Offline flahaie

  • Newbie
  • *
  • Posts: 5
Re: how to set language to latin1 in micro core
« Reply #8 on: October 20, 2011, 06:39:59 PM »
Hi, Like maro said after changing the keyboard to cf (french canadian) the / slash should be a é.
on the console it displays the charachter but there's a lot of bugs related to the keyboard maps...
for example if you open nano and type a series of é it will display as follow:
é é é é é é
instead of :
éééééé
on the console it does not put the "space" between chars but if you type a couple of é directly on the prompt and press and hold backspace until the caret stops you'll notice that it erase some or all characters of the prompt itself.
for exmample:
tc@box~$
after typing é will look like that
tc@box~$ ééééé
nothing special until you erase using backspace
tc@bo

the special character worth 2 normal characters.
they are probably wide chars or something like that.
any program using these characters does not work properly.

curaga:
I cannot find the file lat0-16.psfu can you help me
so I can test the loadfont
thanks

by the way the same bugs appear in microcore 4

thanks

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
The only barriers that can stop you are the ones you create yourself.

Offline flahaie

  • Newbie
  • *
  • Posts: 5
Re: how to set language to latin1 in micro core
« Reply #10 on: October 21, 2011, 06:01:12 PM »
Hi,
just to let you know that I tried setfont and it does not fix the problem.
the major problem is that whenever you write a character that is not from the US english it act like a two character long.

other info that might be useful.
when I type locale
every value is set to C
except the last one.

in my previous post I said that when I open nano and write ééé
it display while i'm typing é é é
when I save and reopen it, it looks like that
ééé   
with the same amount of space after the readable character.

this prove that the non us character are treated like 2character wide and the apps and the console does not know how to manage these.

any idea?

I know that tinycore has only a small community compare to other distros but
I really need this  to work since tc is perfect for pxe boot.

any leeds will help.

Thanks.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: how to set language to latin1 in micro core
« Reply #11 on: October 22, 2011, 05:56:32 AM »
See the getlocale extension for setting up the glibc locales. But I doubt they have an impact with the console mapping.

edit: Done, see

http://wiki.tinycorelinux.net/wiki:console_key_mappings
« Last Edit: October 22, 2011, 06:44:32 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline flahaie

  • Newbie
  • *
  • Posts: 5
Re: how to set language to latin1 in micro core
« Reply #12 on: October 25, 2011, 02:06:41 PM »
Thanks curaga...
this fixes all my problems with the french characters and tn5250 and the console.