[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Writing unicode ncurses applications for busybox
From:       Lavrentiy Ivanov <ookami () mail ! ru>
Date:       2014-11-27 16:09:18
Message-ID: 54774CAE.7050005 () mail ! ru
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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
>>>>>
>>>>
>>>
>>
>


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Thank you a lot for your help.<br>
    After stracing on different machines, I found the problem - lack of
    fonts<br>
    So the correct chain to make busybox support specific language with
    ncurses:<br>
    <br>
    ash.c patch you provided<br>
    correct terminfo database (linux works fine for me)<br>
    correct font, for example Lat15-Fixed16.psf or cyr-sun16.psfu etc<br>
    <br>
    <div class="moz-cite-prefix">On 18.11.2014 16:31, Richard Moore
      wrote:<br>
    </div>
    <blockquote cite="mid:546B4A1C.9050806@richud.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Hi,<br>
      <br>
      Sorry then I don't know the answer - I spent a long time getting
      UTF to work.<br>
      <br>
      This was my writeup , maybe you can find something useful in it.<br>
      <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://www.richud.com/wiki/WHDD_Live_ISO_Boot_CD">http://www.richud.com/wiki/WHDD_Live_ISO_Boot_CD</a><br>
  <br>
      (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.)<br>
      <br>
      This was my BB mailing list mail with patch attached<br>
      <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://lists.busybox.net/pipermail/busybox/2014-June/081021.html">http://lists.busybox.net/pipermail/busybox/2014-June/081021.html</a><br>
  <br>
      Cheers<br>
      <br>
      Rich<br>
      <br>
      <br>
      <div class="moz-cite-prefix">On 18/11/14 13:17, Lavrentiy Ivanov
        wrote:<br>
      </div>
      <blockquote cite="mid:546B46DE.80002@mail.ru" type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        It didn't do the trick fr some reason.. here is my config:<br>
        <br>
        CONFIG_UNICODE_SUPPORT=y<br>
        # CONFIG_UNICODE_USING_LOCALE is not set<br>
        # CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set<br>
        CONFIG_UNICODE_COMBINING_WCHARS=y<br>
        CONFIG_UNICODE_WIDE_WCHARS=y<br>
        # CONFIG_UNICODE_BIDI_SUPPORT is not set<br>
        # CONFIG_UNICODE_NEUTRAL_TABLE is not set<br>
        CONFIG_UNICODE_PRESERVE_BROKEN=y<br>
        <br>
        <br>
        I also tested with CONFIG_UNICODE_USING_LOCALE enabled with the
        same result.<br>
        Can it be because of bad terminal set in TERM envvar? Only
        linux2.2 make TUI looks as it designed.<br>
        <br>
        <br>
        <div class="moz-cite-prefix">On 18.11.2014 14:06, Richard Moore
          wrote:<br>
        </div>
        <blockquote cite="mid:546B2825.6010100@richud.com" type="cite">
          <meta content="text/html; charset=utf-8"
            http-equiv="Content-Type">
          Hi,<br>
          <br>
          It wont work if set in init, it needs to be set after the
          shell is started. <br>
          <br>
          (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)<br>
          <br>
          Regards<br>
          <br>
          Rich<br>
          <br>
          <br>
          <br>
          <div class="moz-cite-prefix">On 18/11/14 11:02, Lavrentiy
            Ivanov wrote:<br>
          </div>
          <blockquote cite="mid:546B2756.5020804@mail.ru" type="cite">
            <meta content="text/html; charset=utf-8"
              http-equiv="Content-Type">
            I tested with <br>
            export ru_RU.UTF-8<br>
            This was set in init script<br>
            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<br>
            In my case it is not displayed at all<br>
            <br>
            <div class="moz-cite-prefix">On 18.11.2014 13:25, Richard
              Moore wrote:<br>
            </div>
            <blockquote cite="mid:546B1EAE.2060103@richud.com"
              type="cite">
              <meta content="text/html; charset=utf-8"
                http-equiv="Content-Type">
              Hi,<br>
              <br>
              You need to set LANG, and it needs to be set in the
              controlling terminal, e.g.<br>
              <br>
              export LANG=en_US.UTF-8<br>
              <br>
              <br>
              Cheers<br>
              <br>
              Rich<br>
              <br>
              <br>
              <br>
              <div class="moz-cite-prefix">On 18/11/14 09:47, Pugnator
                wrote:<br>
              </div>
              <blockquote cite="mid:1416304056.20029343@f81.i.mail.ru"
                type="cite"> Hi all,<br>
                I write ncurses based application which utilizes 
                russian characters. It looks like this:<br>
                <br>
                wchar_t *unicode_string = L"Это юникод";<br>
                mvwprintw(stdscr,1,5,"%ls", unicode_string);    <br>
                <br>
                And it works pretty well on my desktop.<br>
                I enabled all UNCIODE_ config options I found<br>
                <br>
                I enabled terminal: export TERM="linux2.2"<br>
                <br>
                I copied terminfo into my busybox system (kernel 3.2)<br>
                When I run my application, only ascii is printed.
                Unicode chars are absent: no garbage or whatever.<br>
                <br>
                How it can be workarounded if it is possible.
                Application is dynamically linked and all libraries were
                transferred too<br>
                <br>
                <fieldset class="mimeAttachmentHeader"></fieldset>
                <br>
                <pre wrap="">_______________________________________________
busybox mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" \
href="mailto:busybox@busybox.net">busybox@busybox.net</a> <a moz-do-not-send="true" \
class="moz-txt-link-freetext" \
href="http://lists.busybox.net/mailman/listinfo/busybox">http://lists.busybox.net/mailman/listinfo/busybox</a></pre>
  </blockquote>
              <br>
            </blockquote>
            <br>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic