[haiku-bugs] Re: [Haiku] #9696: cal command not aware of UTF-8 strings (was: Terminal - cal command show misaligned text)

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Mon, 22 Apr 2013 19:24:49 -0000

#9696: cal command not aware of UTF-8 strings
----------------------------+-------------------------
   Reporter:  un_spacyar    |      Owner:  nobody
       Type:  bug           |     Status:  new
   Priority:  normal        |  Milestone:  R1
  Component:  Applications  |    Version:  R1/alpha4.1
 Resolution:                |   Keywords:  cal
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  x86
----------------------------+-------------------------
Changes (by pulkomandy):

 * owner:  pulkomandy => nobody
 * keywords:  Terminal, cal => cal
 * component:  Kits/Locale Kit => Applications


Comment:

 "cal" blindly truncate the (correct) string returned by strftime.
 I'm not sure what to do, fixing this properly requires use of wchar
 strings, and I'm not sure we can use them with gcc2 and our old glibc.

 We should use wcsftime() to format the days in unicode, and grab 2 unicode
 chars (not 2 bytes) from that. Or find a way to get 2-letter names for the
 days in a better way.
 One solution would be to rewrite cal into C++ and use the Locale Kit and
 BString. Code could be simpler.

--
Ticket URL: <http://dev.haiku-os.org/ticket/9696#comment:4>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts:

  • » [haiku-bugs] Re: [Haiku] #9696: cal command not aware of UTF-8 strings (was: Terminal - cal command show misaligned text) - pulkomandy