Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #149611 > unrolled thread

Unicode in C Sources

Started byF Russell <fr@random.info>
First post2020-02-01 17:12 +0000
Last post2020-04-18 03:58 +0000
Articles 16 on this page of 96 — 22 participants

Back to article view | Back to comp.lang.c


Contents

  Unicode in C Sources F Russell <fr@random.info> - 2020-02-01 17:12 +0000
    Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-01 17:37 +0000
      Re: Unicode in C Sources Anton Shepelev <anton.txt@gmail.com> - 2020-02-01 20:43 +0300
        Re: Unicode in C Sources Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-02-01 10:57 -0800
          Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 16:58 +0100
            Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-02 17:05 +0000
              Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 19:52 +0100
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-02 19:20 +0000
              Re: Unicode in C Sources Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-03 12:38 +0000
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 09:16 -0500
                  Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 15:32 +0100
                    Re: Unicode in C Sources Öö Tiib <ootiib@hot.ee> - 2020-02-03 09:01 -0800
                    Re: Unicode in C Sources Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-03 21:15 +0000
                Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-04 02:06 +0000
                Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-04 02:19 +0000
                  Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-04 02:50 +0000
                  Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-04 08:16 +0100
      Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-01 18:10 +0000
        Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-01 15:19 -0500
          Re: Unicode in C Sources Manfred <invalid@add.invalid> - 2020-02-02 00:13 +0100
            Re: Unicode in C Sources Manfred <invalid@add.invalid> - 2020-02-02 00:46 +0100
              Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-02 00:24 +0000
            Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-02 08:14 -0500
              Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-02 17:59 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 14:44 -0500
                  Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-02 21:49 +0100
                    Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 16:58 -0500
                      Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 15:33 +0100
                        Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 15:38 +0100
                        Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 10:25 -0500
                          Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 19:11 +0100
                            Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 15:59 -0500
                              Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 16:51 +0100
                                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-04 16:05 -0500
                                Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-19 12:17 -0800
        Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 17:09 +0100
          Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 14:46 -0500
            Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 21:39 +0100
              Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 17:07 -0500
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 13:12 +0100
                  Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 16:46 +0100
                  Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-03 16:47 +0000
                    Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:36 -0800
                      Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 23:56 +0100
                  Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:06 -0500
                    Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 22:25 +0100
                      Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:29 -0800
                        Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-19 12:30 -0800
                          Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-19 14:19 -0800
                            Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-04-02 07:50 -0700
                              Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-04-02 08:16 -0700
                      Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-03 22:33 +0000
                      Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 23:05 -0500
                      Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 23:10 -0500
                    Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 18:05 +0100
                      Re: Unicode in C Sources already5chosen@yahoo.com - 2020-02-04 09:38 -0800
                        Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 18:46 +0100
                      Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-04 16:07 -0500
              Re: Unicode in C Sources Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-02-02 14:54 -0800
        Re: Unicode in C Sources Siri Cruise <chine.bleu@yahoo.com> - 2020-02-03 15:10 -0800
    Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 07:47 +0100
      Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 14:00 +0100
        Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 16:45 +0100
          Re: Unicode in C Sources Guillaume <message@bottle.org> - 2020-02-03 17:54 +0100
          Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 22:36 +0100
            Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-04 16:33 +0100
              Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-04 16:45 +0100
                Re: Unicode in C Sources Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-02-04 13:02 -0800
                  Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-04 23:18 +0100
                    Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 11:07 +0100
                      Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 14:49 +0100
                        Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-16 06:23 -0800
                  Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 10:54 +0100
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 14:51 +0100
                  Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 14:03 +0000
                    Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 16:31 +0100
                      Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 15:59 +0000
                        Re: Unicode in C Sources scott@slp53.sl.home (Scott Lurndal) - 2020-02-05 16:02 +0000
                          Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 16:59 +0000
                            Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 18:02 +0000
                              Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-05 19:37 +0100
                              Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 19:37 +0100
                                Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-05 21:02 +0100
                                  Re: Unicode in C Sources Ian Collins <ian-news@hotmail.com> - 2020-02-06 10:34 +1300
                                  Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 23:10 +0000
                                    Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-06 13:53 +0100
                                      Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-06 13:26 +0000
                                  Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-06 07:27 -0500
                                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 23:03 +0000
                                  Re: Unicode in C Sources Mikko Rauhala <mjr@iki.fi> - 2020-02-06 10:46 +0000
                              Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 21:47 +0100
                              Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 22:50 +0000
                            Re: Unicode in C Sources scott@slp53.sl.home (Scott Lurndal) - 2020-02-07 00:25 +0000
                              Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-07 02:07 +0000
                  Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 16:26 +0100
        Re: Unicode in C Sources antispam@math.uni.wroc.pl - 2020-04-18 03:58 +0000

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#149768

Fromjacobnavia <jacob@jacob.remcomp.fr>
Date2020-02-05 19:37 +0100
Message-ID<r1f20s$q61$1@dont-email.me>
In reply to#149767
Le 05/02/2020 à 19:02, Bart a écrit :
> If I look at my post on Thunderbird, then the letters display correctly, 
> as they do on Googlegroups.
> 
> The quoting of it in your post and Scott's is messed up on Thunderbird, 
> but in Googlegroups, Scott's quote is OK, but your quote of his post 
> which includes mine, shows messed up characters instead of the Greek.
> 
> Copying and pasting from my Thunderbird post to both MS Word and 
> Notepad++ shows the correct glyphs (as it does in Github), but not when 
> pasting into SciTe.
> 
> So the character information is there. However, copying and pasting from 
> your original post, from my Thunderbird, is better behaved. Both seem to 
> use the utf-8 charset.
> 
> In short, I've no idea what's happening or why, but I'm not really 
> surprised as I see this stuff all the time (on TV subtitles too, even 
> attempting to show English - things like punctuation mainly).
> 
> My low expectations are why I made my comment.

This confirms what I have been saying all along. You will ALWAYS find 
problems like these when you use Unicode/utf8...

Is debugging these things really worth the effort?

I am lazy by nature, and try to avoid problems when I can. Why bother?

[toc] | [prev] | [next] | [standalone]


#149769

FromManfred <noname@add.invalid>
Date2020-02-05 19:37 +0100
Message-ID<r1f21q$tp1$1@gioia.aioe.org>
In reply to#149767
On 2/5/2020 7:02 PM, Bart wrote:
> On 05/02/2020 16:59, Ben Bacarisse wrote:
>> scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Bart <bc@freeuk.com> writes:
>>>> On 05/02/2020 15:31, David Brown wrote:
>>>>> On 05/02/2020 15:03, Bart wrote:
>>>>
>>>>>> I find the ASCII "$" extremely useful in C, especially for 
>>>>>> generated C
>>>>>> code, but it's not standard C and while gcc allows "$", some 
>>>>>> compilers
>>>>>> don't like it.
>>>>>>
>>>>>> Notably Tiny C, yet Unicode identifiers are supported. Bizarre.
>>>>>>
>>>>>
>>>>> Does Tiny C support Unicode identifiers?
>>>>
>>>> Well, it compiles this program that Ben posted:
>>>>
>>>> #include <stdio.h>
>>>> #include <math.h>
>>>>
>>>> int main()
>>>> {
>>>>       double φ = 0.5, ω2 = 0.2, θ = -0.5, ω3 = 0.1;
>>>>       printf("%g\n", cos(φ) * ω2 - sin(θ) * ω3);
>>>> }
>>>>
>>>> (Which uses Greek phi, omega and theta in case they don't come out.)
>>>
>>> And that parenthetical comment is the very best reason _not_ to use
>>> Unicode identifiers in C and C++ programs :-)
>>
>> It's (nearly) the third decade of the 21st century.  I take that remark
>> as a rebuke to our profession, but also as a prompt to do better.
>>
>> You should name and shame your posting software (unless you have
>> deliberately configured it to mess up such a well-known character
>> encoding).  I hope there is at least an outstanding bug report against
>> it.  Of course you may have very good reasons to use old and
>> unmaintained (or even unmaintainable) software, but people should still
>> know it can't cope with UTF-8.
>>
> 
> 
> If I look at my post on Thunderbird, then the letters display correctly, 
> as they do on Googlegroups.
> 
> The quoting of it in your post and Scott's is messed up on Thunderbird, 

Same as seen from here. It appears that Scott's post is missing the 
proper Content-Type header.

> but in Googlegroups, Scott's quote is OK, but your quote of his post 
> which includes mine, shows messed up characters instead of the Greek.

It looks like googlegroups assumes utf-8 by default (for a missing 
Content-Type) while Ben's reader assumes something else, thus messing 
the re-encoding.

> 
> Copying and pasting from my Thunderbird post to both MS Word and 
> Notepad++ shows the correct glyphs (as it does in Github), but not when 
> pasting into SciTe.
> 
> So the character information is there. However, copying and pasting from 
> your original post, from my Thunderbird, is better behaved. Both seem to 
> use the utf-8 charset.
> 
> In short, I've no idea what's happening or why, but I'm not really 
> surprised as I see this stuff all the time (on TV subtitles too, even 
> attempting to show English - things like punctuation mainly).
> 
> My low expectations are why I made my comment.
> 
> BTW this is a (partial) screen grab of my post as seen on my Thunderbird:
> 
> https://github.com/sal55/langs/blob/master/fred.png
> 

[toc] | [prev] | [next] | [standalone]


#149771

Fromjacobnavia <jacob@jacob.remcomp.fr>
Date2020-02-05 21:02 +0100
Message-ID<r1f70b$p9i$1@dont-email.me>
In reply to#149769
Le 05/02/2020 à 19:37, Manfred a écrit :
> On 2/5/2020 7:02 PM, Bart wrote:

>>
>> If I look at my post on Thunderbird, then the letters display 
>> correctly, as they do on Googlegroups.
>>
>> The quoting of it in your post and Scott's is messed up on Thunderbird, 
> 
> Same as seen from here. It appears that Scott's post is missing the 
> proper Content-Type header.
> 
>> but in Googlegroups, Scott's quote is OK, but your quote of his post 
>> which includes mine, shows messed up characters instead of the Greek.
> 
> It looks like googlegroups assumes utf-8 by default (for a missing 
> Content-Type) while Ben's reader assumes something else, thus messing 
> the re-encoding.

Wellcome to hell guys!

Now, there a few people participating in this discussion here. Imagine 
when 40-50 programmers are using the same code, in many parts of the 
world, and with completely different editors, text tools whatever.

Go try to find whose editor is at fault when someone messed up the greek 
characters!

[toc] | [prev] | [next] | [standalone]


#149775

FromIan Collins <ian-news@hotmail.com>
Date2020-02-06 10:34 +1300
Message-ID<ha0qo1Fo05iU2@mid.individual.net>
In reply to#149771
On 06/02/2020 09:02, jacobnavia wrote:
> Le 05/02/2020 à 19:37, Manfred a écrit :
>> On 2/5/2020 7:02 PM, Bart wrote:
> 
>>>
>>> If I look at my post on Thunderbird, then the letters display
>>> correctly, as they do on Googlegroups.
>>>
>>> The quoting of it in your post and Scott's is messed up on Thunderbird,
>>
>> Same as seen from here. It appears that Scott's post is missing the
>> proper Content-Type header.
>>
>>> but in Googlegroups, Scott's quote is OK, but your quote of his post
>>> which includes mine, shows messed up characters instead of the Greek.
>>
>> It looks like googlegroups assumes utf-8 by default (for a missing
>> Content-Type) while Ben's reader assumes something else, thus messing
>> the re-encoding.
> 
> Wellcome to hell guys!
> 
> Now, there a few people participating in this discussion here. Imagine
> when 40-50 programmers are using the same code, in many parts of the
> world, and with completely different editors, text tools whatever.
> 
> Go try to find whose editor is at fault when someone messed up the greek
> characters!

Probably the same bloke who used tabs instead of spaces for indentation 😱

All flippancy aside, you have struck the nail firmly on the head.

-- 
Ian.

[toc] | [prev] | [next] | [standalone]


#149779

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-02-05 23:10 +0000
Message-ID<87o8ucocjg.fsf@bsb.me.uk>
In reply to#149771
jacobnavia <jacob@jacob.remcomp.fr> writes:

> Le 05/02/2020 à 19:37, Manfred a écrit :
>> On 2/5/2020 7:02 PM, Bart wrote:
>
>>>
>>> If I look at my post on Thunderbird, then the letters display correctly, as they do on Googlegroups.
>>>
>>> The quoting of it in your post and Scott's is messed up on Thunderbird, 
>>
>> Same as seen from here. It appears that Scott's post is missing the proper Content-Type header.
>>
>>> but in Googlegroups, Scott's quote is OK, but your quote of his post which includes mine, shows messed up characters instead of the Greek.
>>
>> It looks like googlegroups assumes utf-8 by default (for a missing Content-Type) while Ben's reader assumes something else, thus messing the re-encoding.
>
> Wellcome to hell guys!

Welcome to bad software.  Why do we put up with it?  Do you put up with
it from your email or messaging clients?  I wouldn't, and indeed I have
not seen a "moijibake" error in an email for many years.

Note: I am talking a Usenet.  C programs are un-typed text files so they
present all sorts of problems when they use an encoding that can't be
assumed.  However, once Microsoft either sees the light or becomes
irrelevant, a universal assumption of UTF-8 will start be more
reasonable and we can junk the current "let's assume it's US-ASCII"
default.

<cut>
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#149786

FromManfred <noname@add.invalid>
Date2020-02-06 13:53 +0100
Message-ID<r1h27c$1u5n$1@gioia.aioe.org>
In reply to#149779
On 2/6/2020 12:10 AM, Ben Bacarisse wrote:
> However, once Microsoft either sees the light or becomes
> irrelevant, a universal assumption of UTF-8 will start be more
> reasonable and we can junk the current "let's assume it's US-ASCII"
> default.

It is true that MS policy is a major obstacle to the general adoption of 
UTF-8, however, somewhat curiously, one of the motivations to push gcc 
to support Unicode in identifiers (bug 67224) was that MSVC already 
supports it..

[toc] | [prev] | [next] | [standalone]


#149787

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-02-06 13:26 +0000
Message-ID<87a75voniq.fsf@bsb.me.uk>
In reply to#149786
Manfred <noname@add.invalid> writes:

> On 2/6/2020 12:10 AM, Ben Bacarisse wrote:
>> However, once Microsoft either sees the light or becomes
>> irrelevant, a universal assumption of UTF-8 will start be more
>> reasonable and we can junk the current "let's assume it's US-ASCII"
>> default.
>
> It is true that MS policy is a major obstacle to the general adoption
> of UTF-8, however, somewhat curiously, one of the motivations to push
> gcc to support Unicode in identifiers (bug 67224) was that MSVC
> already supports it..

MS is a global company, so they have not been shy of using Unicode.  In
fact, it's their multi-language requirements that prompted early
adoption before UTF-8 was widely used.  They chose UCS16, which was
later extended (in most contexts) to UTF-16 which is where many of the
problems come from.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#149785

FromRichard Damon <Richard@Damon-Family.org>
Date2020-02-06 07:27 -0500
Message-ID<NCT_F.63609$Bz7.10634@fx24.iad>
In reply to#149771
On 2/5/20 3:02 PM, jacobnavia wrote:
> Le 05/02/2020 à 19:37, Manfred a écrit :
>> On 2/5/2020 7:02 PM, Bart wrote:
> 
>>>
>>> If I look at my post on Thunderbird, then the letters display 
>>> correctly, as they do on Googlegroups.
>>>
>>> The quoting of it in your post and Scott's is messed up on Thunderbird, 
>>
>> Same as seen from here. It appears that Scott's post is missing the 
>> proper Content-Type header.
>>
>>> but in Googlegroups, Scott's quote is OK, but your quote of his post 
>>> which includes mine, shows messed up characters instead of the Greek.
>>
>> It looks like googlegroups assumes utf-8 by default (for a missing 
>> Content-Type) while Ben's reader assumes something else, thus messing 
>> the re-encoding.
> 
> Wellcome to hell guys!
> 
> Now, there a few people participating in this discussion here. Imagine 
> when 40-50 programmers are using the same code, in many parts of the 
> world, and with completely different editors, text tools whatever.
> 
> Go try to find whose editor is at fault when someone messed up the greek 
> characters!

This makes the 'rule' to only use ASCII identifiers reasonable for 
projects that can reasonably be expected to see an international audience.

That is NOT most programs.

Most programs are created for internal use within a specific 
organization, and most of those have a limited language base within 
them. In this sort of environment, if the native language is not latin 
based, than using native characters might make the program more readable 
to those that really have a need to read it. In such an environment, the 
problems of tools not dealing with the character set is much less likely 
to come up, as you are unlikely to want to use a tool that can't deal 
with your native character set.

[toc] | [prev] | [next] | [standalone]


#149778

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-02-05 23:03 +0000
Message-ID<87tv44ocwb.fsf@bsb.me.uk>
In reply to#149769
Manfred <noname@add.invalid> writes:

> On 2/5/2020 7:02 PM, Bart wrote:
<cut>
>> If I look at my post on Thunderbird, then the letters display
>> correctly, as they do on Googlegroups.
>>
>> The quoting of it in your post and Scott's is messed up on Thunderbird, 
>
> Same as seen from here. It appears that Scott's post is missing the
> proper Content-Type header.

Yup.  One could say more, but that the gist of it.

>> but in Googlegroups, Scott's quote is OK, but your quote of his post
>> which includes mine, shows messed up characters instead of the Greek.
>
> It looks like googlegroups assumes utf-8 by default (for a missing
> Content-Type) while Ben's reader assumes something else, thus messing
> the re-encoding.

Once the encoding information has been lost, any assumption will be
wrong for some cases and right for others.  With no charset=... (indeed
with not Content-type header) US-ASCII should be assumed (I've just had
a read of the RFCs) so Google Groups is technically wrong here.

<cut>
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#149784

FromMikko Rauhala <mjr@iki.fi>
Date2020-02-06 10:46 +0000
Message-ID<r1gqpe$77p$1@dont-email.me>
In reply to#149778
On Wed, 05 Feb 2020 23:03:16 +0000, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
> Manfred <noname@add.invalid> writes:
>> It looks like googlegroups assumes utf-8 by default (for a missing
>> Content-Type) while Ben's reader assumes something else, thus messing
>> the re-encoding.
>
> Once the encoding information has been lost, any assumption will be
> wrong for some cases and right for others.  With no charset=... (indeed
> with not Content-type header) US-ASCII should be assumed (I've just had
> a read of the RFCs) so Google Groups is technically wrong here.

I think it's a reasonable assumption though on the grounds that
if the message _is_ US-ASCII, decoding it as UTF-8 will result in
the exact correct interpretation. If it's not, well, either you assume
something that might be correct or give up. (Though, it would probably
be practically best to fall back to some other assumption if the content
isn't valid UTF-8 [which it might be if it's an earlier quote that has
been messed up in some earlier stage of the process before encoding
into valid but nonsensical UTF-8, but such is life].)

Apologies for low amount of C content here.

-- 
Mikko Rauhala   - mjr@iki.fi     - http://rauhala.org

[toc] | [prev] | [next] | [standalone]


#149773

FromDavid Brown <david.brown@hesbynett.no>
Date2020-02-05 21:47 +0100
Message-ID<r1f9ki$and$1@dont-email.me>
In reply to#149767
On 05/02/2020 19:02, Bart wrote:

> 
> If I look at my post on Thunderbird, then the letters display correctly, 
> as they do on Googlegroups.
> 

There was nothing wrong with your post (or Ben's).  Scott is using a 
newsreader that was designed long before UTF-8 was conceived.  It's fine 
for a person to like their old software, but they should not be 
surprised when it is missing the features of modern tools .

[toc] | [prev] | [next] | [standalone]


#149777

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-02-05 22:50 +0000
Message-ID<87zhdwodhe.fsf@bsb.me.uk>
In reply to#149767
Bart <bc@freeuk.com> writes:

> On 05/02/2020 16:59, Ben Bacarisse wrote:
>> scott@slp53.sl.home (Scott Lurndal) writes:
>>
>>> Bart <bc@freeuk.com> writes:
>>>> On 05/02/2020 15:31, David Brown wrote:
>>>>> On 05/02/2020 15:03, Bart wrote:
>>>>
>>>>>> I find the ASCII "$" extremely useful in C, especially for generated C
>>>>>> code, but it's not standard C and while gcc allows "$", some compilers
>>>>>> don't like it.
>>>>>>
>>>>>> Notably Tiny C, yet Unicode identifiers are supported. Bizarre.
>>>>>>
>>>>>
>>>>> Does Tiny C support Unicode identifiers?
>>>>
>>>> Well, it compiles this program that Ben posted:
>>>>
>>>> #include <stdio.h>
>>>> #include <math.h>
>>>>
>>>> int main()
>>>> {
>>>>       double φ = 0.5, ω2 = 0.2, θ = -0.5, ω3 = 0.1;
>>>>       printf("%g\n", cos(φ) * ω2 - sin(θ) * ω3);
>>>> }
>>>>
>>>> (Which uses Greek phi, omega and theta in case they don't come out.)
>>>
>>> And that parenthetical comment is the very best reason _not_ to use
>>> Unicode identifiers in C and C++ programs :-)
>>
>> It's (nearly) the third decade of the 21st century.  I take that remark
>> as a rebuke to our profession, but also as a prompt to do better.
>>
>> You should name and shame your posting software (unless you have
>> deliberately configured it to mess up such a well-known character
>> encoding).  I hope there is at least an outstanding bug report against
>> it.  Of course you may have very good reasons to use old and
>> unmaintained (or even unmaintainable) software, but people should still
>> know it can't cope with UTF-8.
>
> If I look at my post on Thunderbird, then the letters display
> correctly, as they do on Googlegroups.
>
> The quoting of it in your post

"It" is confusing here.  "It" does not refer to your post (the only
plausible referent in the preceding sentence) as one might assume.  I
never quoted your post, I quoted Scott's messed-up quoting of your
post.

> and Scott's is messed up on
> Thunderbird, but in Googlegroups, Scott's quote is OK, but your quote
> of his post which includes mine, shows messed up characters instead of
> the Greek.

My post was, as far as I can see, accurate.  It correctly reflected the
incorrect content of Scott's post.  Scott's newsreader simply ignored
the information about the character encoding and assumed a single-byte
encoding.  What's more, it did not include that assumed encoding in the
headers so other newsreaders simply have to guess.  (There may be a
specified default that should be assumed -- I've not checked the RFCs.)

> My low expectations are why I made my comment.

And why I made mine.  We (software engineers) can and should do better.
We (software users) should expect better.

It's not a problem in most email systems.  I send and receive mails with
all sort of encodings and I expect that my software, and that of the
mail's recipients, will do the right thing.  An email client showing
mojibake would be rejected by most users these days.  There's something
about Usenet that seems to attract a mildly Luddite user base.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#149809

Fromscott@slp53.sl.home (Scott Lurndal)
Date2020-02-07 00:25 +0000
Message-ID<R72%F.324501$QU2.141305@fx01.iad>
In reply to#149765
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>scott@slp53.sl.home (Scott Lurndal) writes:
>
>> Bart <bc@freeuk.com> writes:
>>>On 05/02/2020 15:31, David Brown wrote:
>>>> On 05/02/2020 15:03, Bart wrote:
>>>
>>>>> I find the ASCII "$" extremely useful in C, especially for generated C
>>>>> code, but it's not standard C and while gcc allows "$", some compilers
>>>>> don't like it.
>>>>>
>>>>> Notably Tiny C, yet Unicode identifiers are supported. Bizarre.
>>>>>
>>>> 
>>>> Does Tiny C support Unicode identifiers?
>>>
>>>Well, it compiles this program that Ben posted:
>>>
>>>#include <stdio.h>
>>>#include <math.h>
>>>
>>>int main()
>>>{
>>>      double φ = 0.5, ω2 = 0.2, θ = -0.5, ω3 = 0.1;
>>>      printf("%g\n", cos(φ) * ω2 - sin(θ) * ω3);
>>>}
>>>
>>>(Which uses Greek phi, omega and theta in case they don't come out.)
>>
>> And that parenthetical comment is the very best reason _not_ to use
>> Unicode identifiers in C and C++ programs :-)
>
>It's (nearly) the third decade of the 21st century.  I take that remark
>as a rebuke to our profession, but also as a prompt to do better.
>
>You should name and shame your posting software (unless you have
>deliberately configured it to mess up such a well-known character
>encoding).

It's in the headers for each of my posts.

[toc] | [prev] | [next] | [standalone]


#149811

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2020-02-07 02:07 +0000
Message-ID<87v9ojm9pu.fsf@bsb.me.uk>
In reply to#149809
scott@slp53.sl.home (Scott Lurndal) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
<cut>
>>You should name and shame your posting software (unless you have
>>deliberately configured it to mess up such a well-known character
>>encoding).
>
> It's in the headers for each of my posts.

So it is!  I looked and for some reason did not see it.

It's not going to be a problem.  No one is going to settle on using xrn
when coming to Usenet for the first time, and anyone already using it
will know that it follows the 1986 RFC.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#149759

FromDavid Brown <david.brown@hesbynett.no>
Date2020-02-05 16:26 +0100
Message-ID<r1emqf$mre$1@dont-email.me>
In reply to#149756
On 05/02/2020 14:51, Manfred wrote:
> On 2/4/2020 4:45 PM, David Brown wrote:
>> Look, I/know/  about all these potential problems.  I wrote about
>> several of them.  Most of these have already been mentioned.
>>
>> My question was, has anyone/seen/  any of these problems actually
>> occurring in practice with programming languages that support Unicode
>> identifiers.
>>
>> The answer so far is "no" - no one here has come across problems as a
>> result of programming languages supporting Unicode identifiers.  Of
>> course, that could be because no one has bothered answering, or because
>> people in this group mainly use C (though I know that many also use
>> other languages).  I know/I/  have never had issues with Unicode
>> identifiers in Python - I haven't even heard of any, though they have
>> exactly the same potential problems as Unicode identifiers in C.
> 
> Reverting the question, also in terms of actual experience: in what
> circumstances have you found Unicode identifiers substantially more
> useful in practice than ASCII in Python code?

Personally, I have not used them or found a reason to use them.

[toc] | [prev] | [next] | [standalone]


#151378

Fromantispam@math.uni.wroc.pl
Date2020-04-18 03:58 +0000
Message-ID<r7dttn$j51$1@z-news.wcss.wroc.pl>
In reply to#149668
David Brown <david.brown@hesbynett.no> wrote:
> 
> At the risk of straying from C, it's worth noting that Python is quite
> happy with Unicode identifiers such as "? = 3.14", and I believe that is
> common amongst other more modern languages.  Does the ability to write
> non-ASCII identifiers lead to problems with these languages?  Or are we
> (including me here) worrying about nothing?

A few litte tidbits:

1) To have constent behaviour of script my build enviromnent
   set locale to C (after all it the _only_ locale guaranted
   to exit, all other are optional).  In C locale Lisp compiler
   (sbcl) refuses to read anything beyond ASCII, so source files
   containing extended characters can not be compiled.
   One can tell compiler that source uses different character
   set, but this is compiler-specific (must be done differently
   for different compilers).  To make things more "interesting"
   offending characters were in comments and people who put
   then there thougt that they can do no charm...

2) Some text is only available as PDF and I sometimes need to
   paste from PDF to text sources.  Recently I had problem,
   because what looked like minus sign (which was needed in
   source) was in fact a Unicode dash.  Once I realized what
   happened it was trivial, but at first it was puzzling:
   pasted text looked OK and it took some time to notice
   tiny difference between minus sign and dash.

3) I type this text on machine configured to use UTF-8.  But
   it goes trough multiuser machine that uses ISO-8859-2.
   And multiuser machine essentially must use ISO-8859-2,
   because AFAIK for example Polish manual pages and some language
   specific software is only available for ISO-8859-2.
   I could probably set up my stuff there better for UTF-8,
   but a lot of things takes system default and tries to
   use ISO-8859-2.  Effect: for news only ASCII goes trough
   unmolested and I can not actually see the UFT-8 specimens
   posted there.  As I wrote, spending some time I could
   probably set up this better.  But my point is that
   there are still good reasons to set up systems using
   various national code pages and this creates real
   problems when people from various countries need to
   cooperate on code and try to use anything beyond ASCII.

-- 
                              Waldek Hebisch

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | comp.lang.c


csiph-web