Where does FreeBSD tr -C differ from tr -c?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Where does FreeBSD tr -C differ from tr -c?

Cedric Blancher
Has anyone discovered examples for FreeBSD tr -c producing different
output than tr -C?
I tried this (ksh93) test script but it NEVER produces a difference in
the en_US.utf8 and fr_FR.utf-8 locales:

------ snip ------
builtin rm

typeset string
typeset -li16 n_ch ;

for (( n_ch=1 ; n_ch < 0x5000 ; n_ch++ )) ; do
        ch="$(printf "\u[${n_ch/~(El)16#/}]")"
        string+="$ch"
done

typeset -li16 m1 m2
for (( m1=0x32 ; m1 < 0x3000 ; m1+=7 )) ; do
        (( m2=m1+1500 ))
        range="$(printf "\u[${m1/~(El)16#/}]-\u[${m2/~(El)16#/}]")"

        tr -Cd "$range" <<<"$string" >'res_C' &
        tr -cd "$range" <<<"$string" >'res_c' &
        wait
        res_c="$( <'res_c' )"
        res_C="$( <'res_C' )"
        rm 'res_c' 'res_C'

        if [[ "$res_c" != "$res_C" ]] ; then
                printf 'DIFFER range=%q\n' "${range}"
        fi
done
exit 0
------ snip ------

So when does tr -C differ from tr -c? I need examples, please...

Ced
--
Cedric Blancher <[hidden email]>
Institute Pasteur
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Cedric Blancher
On 5 April 2013 16:04, Cedric Blancher <[hidden email]> wrote:

> Has anyone discovered examples for FreeBSD tr -c producing different
> output than tr -C?
> I tried this (ksh93) test script but it NEVER produces a difference in
> the en_US.utf8 and fr_FR.utf-8 locales:
>
> ------ snip ------
> builtin rm
>
> typeset string
> typeset -li16 n_ch ;
>
> for (( n_ch=1 ; n_ch < 0x5000 ; n_ch++ )) ; do
>         ch="$(printf "\u[${n_ch/~(El)16#/}]")"
>         string+="$ch"
> done
>
> typeset -li16 m1 m2
> for (( m1=0x32 ; m1 < 0x3000 ; m1+=7 )) ; do
>         (( m2=m1+1500 ))
>         range="$(printf "\u[${m1/~(El)16#/}]-\u[${m2/~(El)16#/}]")"
>
>         tr -Cd "$range" <<<"$string" >'res_C' &
>         tr -cd "$range" <<<"$string" >'res_c' &
>         wait
>         res_c="$( <'res_c' )"
>         res_C="$( <'res_C' )"
>         rm 'res_c' 'res_C'
>
>         if [[ "$res_c" != "$res_C" ]] ; then
>                 printf 'DIFFER range=%q\n' "${range}"
>         fi
> done
> exit 0
> ------ snip ------
>
> So when does tr -C differ from tr -c? I need examples, please...

Anyone? FreeBSD tr implements option -C but there are no usage
*examples* where exactly it differs from -c.

Ced
--
Cedric Blancher <[hidden email]>
Institute Pasteur
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Andrey Chernov
On 06.04.2013 2:10, Cedric Blancher wrote:
>> I tried this (ksh93) test script but it NEVER produces a difference in
>> the en_US.utf8 and fr_FR.utf-8 locales:

> Anyone? FreeBSD tr implements option -C but there are no usage
> *examples* where exactly it differs from -c.

For -C you need multibyte locale.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Cedric Blancher
On 6 April 2013 11:38, Andrey Chernov <[hidden email]> wrote:
> On 06.04.2013 2:10, Cedric Blancher wrote:
>>> I tried this (ksh93) test script but it NEVER produces a difference in
>>> the en_US.utf8 and fr_FR.utf-8 locales:
>
>> Anyone? FreeBSD tr implements option -C but there are no usage
>> *examples* where exactly it differs from -c.
>
> For -C you need multibyte locale.

I know. I'm looking for examples in whatever locale is suitable for
such locales (fr_FR.UTF-8 or en_US.UTF-8 preferred).

Ced
--
Cedric Blancher <[hidden email]>
Institute Pasteur
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Cedric Blancher
On 6 April 2013 14:58, Cedric Blancher <[hidden email]> wrote:

> On 6 April 2013 11:38, Andrey Chernov <[hidden email]> wrote:
>> On 06.04.2013 2:10, Cedric Blancher wrote:
>>>> I tried this (ksh93) test script but it NEVER produces a difference in
>>>> the en_US.utf8 and fr_FR.utf-8 locales:
>>
>>> Anyone? FreeBSD tr implements option -C but there are no usage
>>> *examples* where exactly it differs from -c.
>>
>> For -C you need multibyte locale.
>
> I know. I'm looking for examples in whatever locale is suitable for
> such locales (fr_FR.UTF-8 or en_US.UTF-8 preferred).

...whatever locale is suitable for such *examples* [not locales]....

Ced
--
Cedric Blancher <[hidden email]>
Institute Pasteur
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Andrey Chernov
On 06.04.2013 17:02, Cedric Blancher wrote:

> On 6 April 2013 14:58, Cedric Blancher <[hidden email]> wrote:
>> On 6 April 2013 11:38, Andrey Chernov <[hidden email]> wrote:
>>> On 06.04.2013 2:10, Cedric Blancher wrote:
>>>>> I tried this (ksh93) test script but it NEVER produces a difference in
>>>>> the en_US.utf8 and fr_FR.utf-8 locales:
>>>
>>>> Anyone? FreeBSD tr implements option -C but there are no usage
>>>> *examples* where exactly it differs from -c.
>>>
>>> For -C you need multibyte locale.
>>
>> I know. I'm looking for examples in whatever locale is suitable for
>> such locales (fr_FR.UTF-8 or en_US.UTF-8 preferred).
>
> ...whatever locale is suitable for such *examples* [not locales]....

Try with Chinese or Japanese ones, non utf-8 first.


_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Sebastian Feld
On Sat, Apr 6, 2013 at 5:33 PM, Andrey Chernov <[hidden email]> wrote:

> On 06.04.2013 17:02, Cedric Blancher wrote:
>> On 6 April 2013 14:58, Cedric Blancher <[hidden email]> wrote:
>>> On 6 April 2013 11:38, Andrey Chernov <[hidden email]> wrote:
>>>> On 06.04.2013 2:10, Cedric Blancher wrote:
>>>>>> I tried this (ksh93) test script but it NEVER produces a difference in
>>>>>> the en_US.utf8 and fr_FR.utf-8 locales:
>>>>
>>>>> Anyone? FreeBSD tr implements option -C but there are no usage
>>>>> *examples* where exactly it differs from -c.
>>>>
>>>> For -C you need multibyte locale.
>>>
>>> I know. I'm looking for examples in whatever locale is suitable for
>>> such locales (fr_FR.UTF-8 or en_US.UTF-8 preferred).
>>
>> ...whatever locale is suitable for such *examples* [not locales]....
>
> Try with Chinese or Japanese ones, non utf-8 first.

FreeBSD tr implements tr -C. There are supposed to be tests to verify
this, right?
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Where does FreeBSD tr -C differ from tr -c?

Cedric Blancher
In reply to this post by Andrey Chernov
On 6 April 2013 17:33, Andrey Chernov <[hidden email]> wrote:

> On 06.04.2013 17:02, Cedric Blancher wrote:
>> On 6 April 2013 14:58, Cedric Blancher <[hidden email]> wrote:
>>> On 6 April 2013 11:38, Andrey Chernov <[hidden email]> wrote:
>>>> On 06.04.2013 2:10, Cedric Blancher wrote:
>>>>>> I tried this (ksh93) test script but it NEVER produces a difference in
>>>>>> the en_US.utf8 and fr_FR.utf-8 locales:
>>>>
>>>>> Anyone? FreeBSD tr implements option -C but there are no usage
>>>>> *examples* where exactly it differs from -c.
>>>>
>>>> For -C you need multibyte locale.
>>>
>>> I know. I'm looking for examples in whatever locale is suitable for
>>> such locales (fr_FR.UTF-8 or en_US.UTF-8 preferred).
>>
>> ...whatever locale is suitable for such *examples* [not locales]....
>
> Try with Chinese or Japanese ones, non utf-8 first.

Do you have any suggestions which ones might be suitable?

Where can I find the FreeBSD localedata sources?

Ced
--
Cedric Blancher <[hidden email]>
Institute Pasteur
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[hidden email]"