Thursday, October 23, 2014

Digest for comp.lang.c++@googlegroups.com - 8 updates in 3 topics

comp.lang.c++@googlegroups.com Google Groups
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Oct 23 10:00PM +0100

On Thu, 23 Oct 2014 21:30:53 +0200
> several others in the respective interfaces of these classes, just
> like for UTF-8 and Latin-1, but that has nothing to do the internal
> storage format.
 
http://qt-project.org/doc/qt-5/qstring.html
"QString stores a string of 16-bit QChars, where each QChar corresponds
one Unicode 4.0 character. (Unicode characters with code values above
65535 are stored using surrogate pairs, i.e., two consecutive QChars.)"
 
http://qt-project.org/wiki/QtStrings
"Internally, QString stores the string using the UTF-16 encoding"
 
Chris
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Oct 23 10:00PM +0100

On Thu, 23 Oct 2014 21:25:10 +0200
> Conversions usually don't require external tools BTW, the methods
> in the QString-interface are just convenience for the most popular
> encodings, a much wider range is available via QTextCodec.
 
This is drivel. QString keeps its data as a raw buffer of 16 bit
unsigned integers (QChar). Everything you say about std::string you can
say about QString.
 
> behaviour for anything not restricted to 7-bits of some unqualified
> encoding (good luck trying to feed a UTF-8 encoded filename into
> fopen() on e.g. Windows...)
 
Many words signifying nothing: see above. QString has virtually nothing
that std::u16string doesn't have, including its unsuitability for use
with UTF-16. On your line that USC-2 is enough, try that one out on
your Chinese consumers.
 
Your windows point is a red herring. I know of no unix-like system
whose C library doesn't accept UTF-8 for filenames, if that happens
also to be the system's narrow filename encoding. As far as fopen() is
concerned, the file name is a concatenation of bytes. However, as you
probably well know, windows uses Windows ANSI as its narrow character
encoding. Complain to microsoft about that.
 
> 5) you need other external libraries if you want these "strings"
> to actually interface with something like the file system. Which
> to me is really beyond insanity.
 
As someone else has pointed out, you don't any more need external
libraries for UTF-8 <-> UTF-16 and UTF-8 <-> UTF32 conversion. C++11
offers that as a built-in specialization of std::codecvt. But that is a
side issue, because there are many others available.
 
And if you want to use QString for UTF-16 as opposed to USC-2, you
would need to do exactly the same yourself. Using UTF-16 with QString
is little different from using UTF-8 with std::string, and no different
from using UTF-16 with std::u16string.
 
You can go on shouting "integration, integration" ("it's the entire
environment it's integrated in, and integrated well"), but those are
just vacuous buzzwords. The QString methods are an overblown set of
functions most of which should be helper functions and not member
functions (including the static member conversion functions), most of
which are provided also by std::u16string (most member functions of
which should also be helper functions) or std::codecvt and all the
others of which are trivially implementable. And QString is a terrible
implementation for a dedicated UTF-16 string, just as std::u16string
is. You have to be blind not to see it.
 
Chris
Christopher Pisz <nospam@notanaddress.com>: Oct 23 05:07PM -0500

On 10/23/2014 3:13 PM, Paavo Helde wrote:
> Andreas Dehmel <blackhole.8.zarquon42@spamgourmet.com> wrote in
> news:20141023212510.7f667f47@kuroneko.dehmel-lan.de:
SNIP
 
> incorporate a huge external library.
 
> Cheers
> Paavo
 
Agree.
Been part of my common library in every project for more than a decade.
What's the big deal?
Andrea <NOSPAM@NOSPAM.COM>: Oct 19 12:55PM +0200

I saw this framework and it seems very interesting (I have done some
tests with the Qt Creator editor and are positively surprised).
 
Does anyone use it? Opinions?
 
--
Victor Bazarov <v.bazarov@comcast.invalid>: Oct 19 08:17AM -0400

On 10/19/2014 6:55 AM, Andrea wrote:
> I saw this framework and it seems very interesting (I have done some
> tests with the Qt Creator editor and are positively surprised).
 
> Does anyone use it? Opinions?
 
My opinion is that some folks use it. Some companies even use it in the
foundation of their commercial products. I think you can find some
testimonials on the web site...
 
V
--
I do not respond to top-posted replies, please don't ask
Paavo Helde <myfirstname@osa.pri.ee>: Oct 19 02:27AM -0500

Emanuel Berg <embe8573@student.uu.se> wrote in
 
> Well then, what is your definition of OO? The one I
> like the best is the coupling of data and the
> algorithms that modify that same data.
 
Yes, but in this example this is done by the implementors of
std::basic_string, not by the user (the end programmer). The program does
not magically turn into OO style by using a std::string variable instead
of a char array. Zero knowledge about OO is needed for using a
std::string variable, it's just slightly different calling syntax.
 
> case here. It doesn't really matter if that is
> implemented as syntactic sugar or not. OO is all about
> interfaces anyway.
 
This somewhat contradicts your previous claim that OO is all about
coupling of data and algorithms working on the same data. These both
sound more like implementation details, not directly interface related.
Bo Persson <bop@gmb.dk>: Oct 19 12:46PM +0200

On 2014-10-19 06:25, Emanuel Berg wrote:
> implemented as syntactic sugar or not. OO is all about
> interfaces anyway. (Well, all good programming is, I
> would argue.)
 
I think the confusion here is that you call the "C with classes" subset
of C++ "Object oriented" when some of us see it as merely "Object
based". :-)
 
A small but significant difference, see
 
http://en.wikipedia.org/wiki/Object-based_programming
http://en.wikipedia.org/wiki/Object-oriented_programming
 
 
Bo Persson
Paavo Helde <myfirstname@osa.pri.ee>: Oct 19 02:34AM -0500

pkoniusz@gmail.com wrote in
 
> Dear Stefan and Robert.
 
> I don't mind if I get this behaviour on a specific platform only.
> Portability is not an issue at this point at all. I use linux with the
 
On Linux, use mmap() and mremap(). The latter seems like a direct hit for
your concerns.
 
Cheers
Paavo
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: