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


Groups > comp.lang.c++ > #44552 > unrolled thread

"Unicode"

Started byLynn McGuire <lynnmcguire5@gmail.com>
First post2016-08-29 12:06 -0500
Last post2016-09-08 02:16 +0200
Articles 4 on this page of 64 — 15 participants

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


Contents

  "Unicode" Lynn McGuire <lynnmcguire5@gmail.com> - 2016-08-29 12:06 -0500
    Re: "Unicode" Daniel <danielaparker@gmail.com> - 2016-08-29 11:52 -0700
      Re: "Unicode" Lynn McGuire <lynnmcguire5@gmail.com> - 2016-08-30 12:24 -0500
        Re: "Unicode" legalize+jeeves@mail.xmission.com (Richard) - 2016-08-30 18:50 +0000
          Re: "Unicode" Lynn McGuire <lynnmcguire5@gmail.com> - 2016-08-30 14:11 -0500
            Re: "Unicode" legalize+jeeves@mail.xmission.com (Richard) - 2016-08-30 19:44 +0000
          Re: "Unicode" Vir Campestris <vir.campestris@invalid.invalid> - 2016-08-30 21:29 +0100
            Re: "Unicode" legalize+jeeves@mail.xmission.com (Richard) - 2016-08-31 20:31 +0000
              Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-01 01:50 +0200
                Re: "Unicode" Daniel <danielaparker@gmail.com> - 2016-08-31 18:47 -0700
                  Re: "Unicode" "Osmium" <r124c4u102@comcast.net> - 2016-09-01 06:01 -0500
                Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-08-31 23:06 -0400
                  Re: "Unicode" Ian Collins <ian-news@hotmail.com> - 2016-09-01 15:21 +1200
                    Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-01 15:07 -0400
                  Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-01 08:02 +0200
                    Re: "Unicode" legalize+jeeves@mail.xmission.com (Richard) - 2016-09-01 18:46 +0000
                  Re: "Unicode" David Brown <david.brown@hesbynett.no> - 2016-09-01 10:09 +0200
                  Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-01 17:58 +0100
                    Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-01 15:08 -0400
                      Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-01 21:20 +0100
                        Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-01 20:52 -0400
                          Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-02 14:44 +0100
                            Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-02 10:10 -0400
                              Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-02 16:35 +0100
                                Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-02 12:26 -0400
                              Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-02 17:02 +0100
                                Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-02 12:33 -0400
                                  Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-02 17:53 +0100
                                    Re: "Unicode" Gareth Owen <gwowen@gmail.com> - 2016-09-02 19:20 +0100
                                    Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-02 16:36 -0400
                                      Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-02 21:45 +0100
                                        Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-02 19:57 -0400
                Re: "Unicode" legalize+jeeves@mail.xmission.com (Richard) - 2016-09-01 18:45 +0000
                  Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-01 15:11 -0400
                  Re: "Unicode" David Brown <david.brown@hesbynett.no> - 2016-09-01 22:27 +0200
                    Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-01 21:37 +0100
                    Re: "Unicode" Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-01 20:53 -0400
                  Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-02 05:57 +0200
        Re: "Unicode" Bo Persson <bop@gmb.dk> - 2016-08-30 21:30 +0200
          Re: "Unicode" Bo Persson <bop@gmb.dk> - 2016-08-30 21:40 +0200
          Re: "Unicode" Daniel <danielaparker@gmail.com> - 2016-08-30 13:39 -0700
    Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-01 21:54 +0100
      Re: "Unicode" raltbos@xs4all.nl (Richard Bos) - 2016-09-03 08:00 +0000
        Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-03 14:10 -0500
          Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-04 09:56 +0200
            Re: "Unicode" Paavo Helde <myfirstname@osa.pri.ee> - 2016-09-04 14:37 +0300
              Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-05 12:53 +0200
                Re: "Unicode" Paavo Helde <myfirstname@osa.pri.ee> - 2016-09-05 15:30 +0300
                  Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-05 16:13 +0200
                    Re: "Unicode" Paavo Helde <myfirstname@osa.pri.ee> - 2016-09-05 22:03 +0300
                      Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-05 23:54 +0200
                        Re: "Unicode" Keith Thompson <kst-u@mib.org> - 2016-09-05 15:35 -0700
                          Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-06 00:18 +0200
                            Re: "Unicode" Keith Thompson <kst-u@mib.org> - 2016-09-05 16:17 -0700
                              Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-06 01:20 +0200
                                Re: "Unicode" Keith Thompson <kst-u@mib.org> - 2016-09-05 17:16 -0700
                                  Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-06 02:42 +0200
                        Re: "Unicode" Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-09-05 23:05 +0100
            Re: "Unicode" Vir Campestris <vir.campestris@invalid.invalid> - 2016-09-04 21:37 +0100
              Re: "Unicode" Paavo Helde <myfirstname@osa.pri.ee> - 2016-09-05 00:22 +0300
                Re: "Unicode" Vir Campestris <vir.campestris@invalid.invalid> - 2016-09-05 21:32 +0100
                  Re: "Unicode" Paavo Helde <myfirstname@osa.pri.ee> - 2016-09-06 00:00 +0300
                    Re: "Unicode" Vir Campestris <vir.campestris@invalid.invalid> - 2016-09-07 21:19 +0100
                      Re: "Unicode" "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-09-08 02:16 +0200

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


#44877

FromVir Campestris <vir.campestris@invalid.invalid>
Date2016-09-05 21:32 +0100
Message-ID<wPOdneAYmKDDS1DKnZ2dnUU78f_NnZ2d@brightview.co.uk>
In reply to#44840
On 04/09/2016 22:22, Paavo Helde wrote:
> On 4.09.2016 23:37, Vir Campestris wrote:
>>
>> I don't recall the API off the top of my head, but I do recall that you
>> can set your character set to UTF-8 in Windows.
>
> Sure you can set it ... but the machine won't boot up again after
> restart. At least this was my experience when I last tried that.

Never tried it at a system level, only within an app.

And of course, once you've done it, Alf's

 >> std::ofstream f( utf8_file_path );

maps down to CreateFileA, with a glue layer converting the current UTF-8 
code page into UTF-16 for the underlying CreateFileW call - and all is good.

Windows is shit, but it's not _that_ shit :)

Andy

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


#44878

FromPaavo Helde <myfirstname@osa.pri.ee>
Date2016-09-06 00:00 +0300
Message-ID<y-qdnS41zcF8QVDKnZ2dnUU78bnNnZ2d@giganews.com>
In reply to#44877
On 5.09.2016 23:32, Vir Campestris wrote:
> On 04/09/2016 22:22, Paavo Helde wrote:
>> On 4.09.2016 23:37, Vir Campestris wrote:
>>>
>>> I don't recall the API off the top of my head, but I do recall that you
>>> can set your character set to UTF-8 in Windows.
>>
>> Sure you can set it ... but the machine won't boot up again after
>> restart. At least this was my experience when I last tried that.
>
> Never tried it at a system level, only within an app.
>
> And of course, once you've done it, Alf's
>
>  >> std::ofstream f( utf8_file_path );
>
> maps down to CreateFileA, with a glue layer converting the current UTF-8
> code page into UTF-16 for the underlying CreateFileW call - and all is
> good.
>
> Windows is shit, but it's not _that_ shit :)

This is interesting. So how do you set the UTF-8 locale for a Windows 
process? The setlocale() function is documented to fail, see 
https://msdn.microsoft.com/en-us/library/x99tb11d.aspx :

"The set of available locale names, languages, country/region codes, and 
code pages includes all those supported by the Windows NLS API except 
code pages that require more than two bytes per character, such as UTF-7 
and UTF-8. If you provide a code page value of UTF-7 or UTF-8, setlocale 
will fail, returning NULL."


(Yes, you can imbue a stream with some converter which converts the text 
output from utf-8 to utf-16 (though why anybody would need that?), but 
this is not what we are talking about here.)


Cheers
Paavo

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


#44936

FromVir Campestris <vir.campestris@invalid.invalid>
Date2016-09-07 21:19 +0100
Message-ID<I9idnSszcJ7K603KnZ2dnUU78afNnZ2d@brightview.co.uk>
In reply to#44878
On 05/09/2016 22:00, Paavo Helde wrote:
> On 5.09.2016 23:32, Vir Campestris wrote:
>> On 04/09/2016 22:22, Paavo Helde wrote:
>>> On 4.09.2016 23:37, Vir Campestris wrote:
>>>>
>>>> I don't recall the API off the top of my head, but I do recall that you
>>>> can set your character set to UTF-8 in Windows.
>>>
>>> Sure you can set it ... but the machine won't boot up again after
>>> restart. At least this was my experience when I last tried that.
>>
>> Never tried it at a system level, only within an app.
>>
>> And of course, once you've done it, Alf's
>>
>>  >> std::ofstream f( utf8_file_path );
>>
>> maps down to CreateFileA, with a glue layer converting the current UTF-8
>> code page into UTF-16 for the underlying CreateFileW call - and all is
>> good.
>>
>> Windows is shit, but it's not _that_ shit :)
>
> This is interesting. So how do you set the UTF-8 locale for a Windows
> process? The setlocale() function is documented to fail, see
> https://msdn.microsoft.com/en-us/library/x99tb11d.aspx :
>
> "The set of available locale names, languages, country/region codes, and
> code pages includes all those supported by the Windows NLS API except
> code pages that require more than two bytes per character, such as UTF-7
> and UTF-8. If you provide a code page value of UTF-7 or UTF-8, setlocale
> will fail, returning NULL."
>
>
> (Yes, you can imbue a stream with some converter which converts the text
> output from utf-8 to utf-16 (though why anybody would need that?), but
> this is not what we are talking about here.)
>

This is weird. You can call chcp 65001 on a command prompt to set it to 
UTF-8, and I'm absolutely certain I've done it from an app in the past. 
And yet I can't find the documentation for it anywhere. I wonder if it's 
something that used to work, but doesn't any more?

It's either that or too much Linux has rotted my brain.

Andy

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


#44940

From"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>
Date2016-09-08 02:16 +0200
Message-ID<nqqam8$906$1@dont-email.me>
In reply to#44936
On 07.09.2016 22:19, Vir Campestris wrote:
<>
> This is weird. You can call chcp 65001 on a command prompt to set it to
> UTF-8, and I'm absolutely certain I've done it from an app in the past.
> And yet I can't find the documentation for it anywhere. I wonder if it's
> something that used to work, but doesn't any more?

The Windows API level has never supported UTF-8 in consoles. The 
behavior has been as if errors are sticky. Output could work till the 
first non-ASCII character, but input wouldn't work at all (down at the 
API level).

In Windows versions before Windows 8, using codepage 65000 would get you 
funny “out of memory” and other errors, from e.g. "more" command:

[example]
[c:\my\forums\clc++]
 > chcp 65000
Active code page: 65000

[c:\my\forums\clc++]
 > more
Not enough memory.

[c:\my\forums\clc++]
 > ver
Microsoft Windows [Version 6.1.7601]
[/example]

I'm not sure exactly when that was fixed, but as I recall it's not that 
same idiotic error message in Windows 10; maybe no error.

Windows 10 got a lot of improvements in the console subsystem, including 
ordinary shortkeys for copy/paste, unwrapping of wrapped output lines, 
and once again support for ANSI escape sequences.

However, the escape sequence support isn't quite quite yet, and it 
doesn't work with Windows Script Host, apparently because WSH uses 
direct Unicode console i/o while (apparently) the escape sequences only 
work for byte streams  --  which is sort of ironic, that the now almost 
deprecated WSH console i/o is not poor enough to get the benefits…


Cheers!,

- Alf

[toc] | [prev] | [standalone]


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

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


csiph-web