public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Martisko <jamartis@redhat.com>
To: Rafal Luzynski <digitalfreak@lingonborough.com>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH][BZ #15527] strftime_l.c: Support lowercase output
Date: Mon, 05 Dec 2016 14:55:00 -0000	[thread overview]
Message-ID: <58457FE6.9060803@redhat.com> (raw)
In-Reply-To: <1809687502.1414502.1480634954216@poczta.nazwa.pl>

Hello Rafal,

as for the order of ^# flags - right now the change case
flag works as an upper case flag for options which are in
title case by default (Sun -> SUN) and as lowercase for
those, which are in uppercase by default (AM -> am). In my
opinion, treating "%^#A" and "%#^A" as an idiom for lower
case makes the most sense. If you consider "%#^A", the
output would switch case (whatever that means) and then be
switched to uppercase. The "#" flag would thus be ignored.

As for the title case part of your message, I am probably
not the right person to answer it:-(.

Regards,
Jakub

On 2.12.2016 00:29, Rafal Luzynski wrote:
> Hi,
> 
> (Top-posting to conform to the style you already started. ;)
> 
> Your patch has drawn my attention. I must admit that I have not
> analyzed it very thoroughly but OTOH I'm not the right person to
> say the patch should be committed.
> 
> Only one question: what would be the order of applying
> the flags? Should "%^#A" mean "convert to uppercase and then
> swap" or "swap the case and then convert to uppercase" or
> should it be an idiom to "convert to lowercase" no matter
> what is the actual order? Should "%^#A" do the same as "%#^A"?
> 
> At first sight it may seem that usefulness of this feature
> is limited: who would need a "convert to lowercase" switch
> if all letters are already lowercase and those which are
> uppercase (first letters of months names and weekdays names)
> should always be uppercase?
> 
> But that's true only for English, German and maybe few other
> languages. Not true for lots of others, including my and also
> I guess your language. In many languages there is no rule
> saying that month names and weekday names should always begin
> with uppercase but other rules may apply: it should begin with
> uppercase if it's a beginning of a sentence or a beginning of
> a title. I really don't like months names (standalone) or weekday
> names (a full date starting with a weekday name) starting with
> lowercase just because in English they are always uppercase
> and developers don't have to worry about it so they eventually
> leave all other languages in all lowercase. I really wish there
> was a strftime() flag converting words to titlecase. We have
> "convert to uppercase" and "swap the case" but no "convert to
> lowercase" nor "convert the first letter to uppercase". OTOH,
> the implementation of this feature should not be left to the app
> developers because not all languages need it, and converting
> to the uppercase/titlecase is not a trivial task (in case of
> UTF-8, how many bytes are occupied by the first letter? how
> many bytes will its uppercase version occupy? does the letter
> feature only lowercase and uppercase or is it a ligature
> and has it a separate titlecase, like lj → Lj → LJ?) so better
> should be implemented by a core library.
> 
> Unfortunately, I don't have a good candidate for a "convert
> to lowercase" or a "convert to titlecase" switch. But your
> patch solves the problem if we also provide all months names
> and all weekday names in all locale data for all languages
> in titlecase, even if a language does not require it by default.
> Then we would have:
> 
> "%^A" - convert to uppercase => "SUNDAY";
> "%#A" - swap the case => "sUNDAY" (yes, not useful);
> "%^#A" - convert to lowercase => "sunday" (in the middle of
>          a sentence, as required in many languages but not
>          in English);
> "%A" - leave unchanged, titlecase => "Sunday" (default, always
>        in English and some other languages, required in the
>        beginning of a sentence in many other languages).
> 
> We would have a way to convert all words to any (reasonable)
> case and the decision would be always left for the translators
> without any change in any application code. What do you guys think?
> 
> Regards,
> 
> Rafal
> 
> 
> 29.11.2016 13:41 Jakub Martisko <jamartis@redhat.com> wrote:
>>
>>
>> Sorry, this was supposed to be a reply to:
>> https://sourceware.org/ml/libc-alpha/2016-06/msg00575.html
>>
>> On 29.11.2016 13:21, Jakub Martisko wrote:
>>> Hi, are there any updates regarding this functionality?
>>>
>>> On 15.6.2016 10:54, Jakub Martisko wrote:
>>>> strftime_l.c doe not provide easy way to produce lowercase
>>>> output. While the function to create lowercase is
>>>> implemented, there is no flag which would cause it to be
>>>> called. Provided patch checks, whether combination of
>>>> to_uppcase and change_case flags is used and sets to_lowcase
>>>> if both of them are set which leads to lower case output.
>>>>

  reply	other threads:[~2016-12-05 14:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  8:54 Jakub Martisko
2016-06-15  9:09 ` Andreas Schwab
2016-06-29  7:55   ` Jakub Martisko
2016-12-06 23:20     ` Mike Frysinger
2016-12-07 10:18       ` Jakub Martisko
2016-12-07 15:39         ` Mike Frysinger
2016-12-09  1:14           ` Rafal Luzynski
2016-12-09  4:08             ` Mike Frysinger
2016-12-09 11:00               ` Rafal Luzynski
2016-12-09 16:20                 ` Mike Frysinger
2016-12-09 22:37                   ` Rafal Luzynski
2017-04-07 23:29                     ` Rafal Luzynski
2016-11-29 12:21 ` Jakub Martisko
2016-11-29 12:42   ` Jakub Martisko
2016-12-01 23:29     ` Rafal Luzynski
2016-12-05 14:55       ` Jakub Martisko [this message]
2016-12-06 22:47         ` Rafal Luzynski
2016-12-06 23:21 ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2016-05-12 15:26 [PATCH][BZ 15527] " Jakub Martisko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58457FE6.9060803@redhat.com \
    --to=jamartis@redhat.com \
    --cc=digitalfreak@lingonborough.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).