Writing unicode ncurses applications for busybox

2014-11-18 Thread Pugnator
 Hi all,
I write ncurses based application which utilizes  russian characters. It looks 
like this:

wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);    

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are absent: no 
garbage or whatever.

How it can be workarounded if it is possible. Application is dynamically linked 
and all libraries were transferred too
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: Writing unicode ncurses applications for busybox

2014-11-18 Thread Lavrentiy Ivanov

I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as  
but it seems to be ls-related. I saw uch an issues in mailing list

In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:

Hi,

You need to set LANG, and it needs to be set in the controlling 
terminal, e.g.


export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:

Hi all,
I write ncurses based application which utilizes  russian characters. 
It looks like this:


wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are 
absent: no garbage or whatever.


How it can be workarounded if it is possible. Application is 
dynamically linked and all libraries were transferred too



___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox




___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: Writing unicode ncurses applications for busybox

2014-11-18 Thread Lavrentiy Ivanov

It didn't do the trick fr some reason.. here is my config:

CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_UNICODE_COMBINING_WCHARS=y
CONFIG_UNICODE_WIDE_WCHARS=y
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
CONFIG_UNICODE_PRESERVE_BROKEN=y


I also tested with CONFIG_UNICODE_USING_LOCALE enabled with the same result.
Can it be because of bad terminal set in TERM envvar? Only linux2.2 make 
TUI looks as it designed.



On 18.11.2014 14:06, Richard Moore wrote:

Hi,

It wont work if set in init, it needs to be set after the shell is 
started.


(I made a patch ash.c to force it to always be set though if that is 
helpful, if you look at the mailing list archive it should be there)


Regards

Rich



On 18/11/14 11:02, Lavrentiy Ivanov wrote:

I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as  
but it seems to be ls-related. I saw uch an issues in mailing list

In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:

Hi,

You need to set LANG, and it needs to be set in the controlling 
terminal, e.g.


export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:

Hi all,
I write ncurses based application which utilizes  russian 
characters. It looks like this:


wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are 
absent: no garbage or whatever.


How it can be workarounded if it is possible. Application is 
dynamically linked and all libraries were transferred too



___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox








___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: Writing unicode ncurses applications for busybox

2014-11-18 Thread Rich Felker
On Tue, Nov 18, 2014 at 12:47:36PM +0300, Pugnator wrote:
>  Hi all,
> I write ncurses based application which utilizes  russian characters. It 
> looks like this:
> 
> wchar_t *unicode_string = L"Это юникод";
> mvwprintw(stdscr,1,5,"%ls", unicode_string);    
> 
> And it works pretty well on my desktop.
> I enabled all UNCIODE_ config options I found
> 
> I enabled terminal: export TERM="linux2.2"
> 
> I copied terminfo into my busybox system (kernel 3.2)
> When I run my application, only ascii is printed. Unicode chars are absent: 
> no garbage or whatever.
> 
> How it can be workarounded if it is possible. Application is dynamically 
> linked and all libraries were transferred too

Busybox has nothing to do with how your own applications behave,
unless they're calling out to the system utilities to do things. I
suspect either your libc (uclibc?) was built without locale/UTF-8
support, or your ncurses was built without wide character support. If
you're using Buildroot or a similar tool, it should offer you the
option to configure these aspects of the build.

Rich
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: Writing unicode ncurses applications for busybox

2014-11-27 Thread Lavrentiy Ivanov

Thank you a lot for your help.
After stracing on different machines, I found the problem - lack of fonts
So the correct chain to make busybox support specific language with ncurses:

ash.c patch you provided
correct terminfo database (linux works fine for me)
correct font, for example Lat15-Fixed16.psf or cyr-sun16.psfu etc

On 18.11.2014 16:31, Richard Moore wrote:

Hi,

Sorry then I don't know the answer - I spent a long time getting UTF 
to work.


This was my writeup , maybe you can find something useful in it.

http://www.richud.com/wiki/WHDD_Live_ISO_Boot_CD

(Note that setting the LANG in rcS only works when WHDD fires up, if 
WHDD is exited and then restarted UTF support won't work as the 
variable is then no longer set in that terminal.)


This was my BB mailing list mail with patch attached

http://lists.busybox.net/pipermail/busybox/2014-June/081021.html

Cheers

Rich


On 18/11/14 13:17, Lavrentiy Ivanov wrote:

It didn't do the trick fr some reason.. here is my config:

CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_UNICODE_COMBINING_WCHARS=y
CONFIG_UNICODE_WIDE_WCHARS=y
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
CONFIG_UNICODE_PRESERVE_BROKEN=y


I also tested with CONFIG_UNICODE_USING_LOCALE enabled with the same 
result.
Can it be because of bad terminal set in TERM envvar? Only linux2.2 
make TUI looks as it designed.



On 18.11.2014 14:06, Richard Moore wrote:

Hi,

It wont work if set in init, it needs to be set after the shell is 
started.


(I made a patch ash.c to force it to always be set though if that is 
helpful, if you look at the mailing list archive it should be there)


Regards

Rich



On 18/11/14 11:02, Lavrentiy Ivanov wrote:

I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as 
 but it seems to be ls-related. I saw uch an issues in mailing list

In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:

Hi,

You need to set LANG, and it needs to be set in the controlling 
terminal, e.g.


export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:

Hi all,
I write ncurses based application which utilizes russian 
characters. It looks like this:


wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars 
are absent: no garbage or whatever.


How it can be workarounded if it is possible. Application is 
dynamically linked and all libraries were transferred too



___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox












___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox