« first day (362 days earlier)      last day (4593 days later) » 

3:00 PM
@CatPlusPlus You get a Captain Obvious upvote.
 
pity we can't have a Captain Your-Question-Is-Silly :P
wtb my SSD
 
No, I don't want to buy an used SSD.
 
no, I want to get my SSD :P
it's stuck in storage and I'm using the slow-ass labs machines
 
> "Look, we don't have time for all these foolish ideas," Vince said. "Just have them fax it to us. They can take that hex dump, print it out, and fax it to us. We'll use the interns to type it back in, and then you can load it up in the debugger, and then there's no way we could possibly catch a virus. Call the customer and tell them to do that."
 
heh heh
I love that
 
3:12 PM
> There was an extremely long pause at the other end of the line. Eventually the customer said, "You work for a group of morons."
lol
 
@RMartinhoFernandes I've read it when it was published but I still laughed.
 
yeah
it's pretty funny
also, here's a question
how the hell do I type a hash character with a crappy Mac keyboard on Windows 7?
the alt-3 recommended only seems to function for Mac
 
You mean #?
 
that
maybe I'll just chuck it on to the clipboard
hard to start including headers and defining things with no hash
 
My friends that use Macs with Windows google for it and copy-paste.
I'm sure there's a better way.
There has to be.
 
3:16 PM
it's a Mac, who says there's a logical way to do it?
although it seems to me that a character in the ASCII region should be accessible on every keyboard
especially considering that Macs have ± §, which are pretty silly
 
Yeah, that's like, the best key on the keyboard.
 
like, the most useless key on the keyboard
 
"I think the Standard reference is 13.8.2 §3, ±2 I'm not sure."
 
I can type § on my keyboard too, but I need a AltGr modifier.
If I was the Rick from the story, after "You work for morons", I'd probably just tell them to fax me some random hex characters, and give me a link to download the dump.
 
rofl!
yeah, what's Vince gonna do, compare it character-by-character?
 
3:20 PM
I just pity the interns.
Oh noes, there's a rickroll in the HTML comments.
 
what is peek() ?
 
uh
woman.skirts().peek()?
cin.peek()?
 
@DeadMG cin.peek() yes:)
 
cleavage.peek()?
 
You're treating women like objects again?
 
3:22 PM
MyCustomClass.DoSomethingTotallyRandom().ReturnAnObjectRelatingToAnotherMachine.‌​peek()?
@RMartinhoFernandes niiiice
besides, you don't have to peek at cleavage, usually you can just look
 
briefly
 
@MrAnubis It reads the next character, without consuming it.
 
hey, I often stop and stare
if you don't want men to look, do up some more buttons
 
If we use the term 'string' for the Standard container-like std::basic_string (and others), what should we call an encoding aware type?
 
i shouldn't have asked that question rather than searching it, though i didn't know it belongs to cin , that's why had to ask
 
3:25 PM
what, you mean like, utf8_string?
atm I'm going to do something totally blind and just use UCS-2 instead of UTF-16
 
What's the difference?
 
@LucDanton thanks for answering my that question :)
 
I.e. is there a name that won't mislead a user to think that e.g. operator[] is not a random-access operation to access the n-th code unit?
 
UCS-2 doesn't have surrogate pairs, IIRC.
 
UCS-2 is fixed-width
it contains everything in the BMP but not all Unicode characters
 
3:27 PM
Ah.
 
besides, it's not like Visual Studio supports the utf16 stuff from C++11
so wchar_t and wstring is the best I'll get
I'll come back and re-write it later
 
@LucDanton How about characterAt() instead of operator[]?
 
@RMartinhoFernandes so if i doesn't extract the character , it will remain in buffer right?, and cin.peek() will keep outputting the same character
 
probably best to just name it with the encoding
 
@MrAnubis Yes.
 
3:33 PM
@Praetorian That helps yes, I was looking for the name of the type though, not the operation.
 
if you have a variable of type UTF8String or something, then it's probably going to be obvious that you're indexing into variable-length
 
@DeadMG std::u32string is named after the encoding but is not encoding-aware.
 
@DeadMG Pity the standard uses std::u16string.
 
@RMartinhoFernandes thanks :)
 
@LucDanton Uh, what the hell? How can the Standard have named a string "u32string" but not actually have it be UTF-32?
 
3:34 PM
UTF-32 is fixed width.
 
@DeadMG std::basic_string is more like a container than a type for text operations.
 
no, I'm pretty sure that all UTFs are variable-length
 
The Unicode guys have stated that they won't add more than 2^32 characters.
 
@RMartinhoFernandes Bwahaha, combining characters.
 
@DeadMG All except UTF-32
 
3:35 PM
well, that sounds pretty reasonable
 
Keep forgetting that crap.
@LucDanton Damn.
 
so realistically, given that my CPU is best suited to indexing in 32bits, it seems most logical to go to UTF-32
pity that wchar_t is 16bit on MSVC
 
@LucDanton Wait, a code point is a character no?
 
C++11 talks of a char32_t
 
oh, by the way
 
3:36 PM
I was just considering is there was a name that reflects 'text operations' as the Standard string types are for 'code unit operations'.
 
how can u32string be not encoding aware, if there are no variable-lengths?
what operations would be required to support the encoding, in addition to just containing a bunch of 32bit character points?
 
@RMartinhoFernandes 'Character' is problematic (but 'combining character' is the preferred term, sorry). Point being, two codepoints can result in one displayed glyph.
 
is that still true for UTF-32?
 
@LucDanton So what would the indexing operation return?
 
@DeadMG Combining characters, normal forms, collation, etc.
 
3:37 PM
@DeadMG Zalgo.
 
ah
 
Let me check if comparing strings is encoding-aware.
 
you know, this sounds like a horrendously bad idea to me
who came up with this?
why not just move straight to 32 bits, and have just fixed-length characters?
 
Yes, humankind sucks terribly when doing text with computers.
 
32bits is more than enough to store every character ever devised
 
3:39 PM
Comparing strings is not encoding aware. In C++ the string types are code units containers. Encoding happens with e.g. streams.
 
@DeadMG That's what the normal forms are for btw.
 
so why on earth does UTF-32 need combining characters, or normal forms?
actually on second thought
what even is combining characters, normal forms, and collation?
 
"Please put my text in the form with no combining characters." (This is straining my knowledge of Unicode though.)
@DeadMG The first is the silly thing that makes two codepoints behave as one glyph, the second I just described, the final one is ordering.
 
@DeadMG I think combining characters is like adding an accent to a letter
 
3:40 PM
ok
but surely 32bits is more than big enough to simply have one value for the letter normally and one value for the letter with an accent
 
Not for all combinations.
 
uh, 32bits? 4 billion characters? that's got to be enough
 
@DeadMG That's kind of brute-forcish
 
@DeadMG Some languages allow more than one "accent" per letter.
 
Hmm ... maybe if all gazillion Chinese characters can also have accents, you might run out of space?
 
3:42 PM
hmmm
 
Collation example: does 'Buße' come before or after 'Busse'? You can't just look at the value of code units (aka code values).
 
maybe I should just go back to only supporting ASCII?
 
Yes! Make the whole world speak English, problem solved
 
@DeadMG It might not be enough a few centuries from now when we are doing trade with the aliens.
 
Just send them a virus to the mothership.
 
3:43 PM
not unreasonable to have to re-write software in a few centuries
 
Problem solved.
 
@DeadMG It never goes well.
 
So in other words std::u32string is good for storing text and passing around, just not manipulating it. Hence why I'm looking for a nice name for a text-oriented type.
u32text!
Which I guess would be a (character type, encoding, locale) triplet or something.
 
text sucks :(
 
@DeadMG It's not a problem domain I find very fun either, yeah.
 
3:45 PM
Text and time suck.
 
the thing is
time, I can understand
 
Also note that std::string is good for storing/passing UTF-32 text, too!
 
it is different times in different parts of the world, and there's nothing that we hUmOns can do about it
but text?
would be nice if we would put in some effort
 
having everyone speak English would be nice :P
 
3:46 PM
A good way to find out if a distant planet harbors an advanced civilization is to see if its translation period is a multiple of its rotation period. Surely it's easier to fix a planet's orbit than to fix calendars.
 
@DeadMG Yeah you can, get everyone to think in UTC. there's nothing that says you can't begin your day at 8 pm
 
@DeadMG I speak(?) English and I don't see the appeal.
 
the purpose of having everyone speak English is not that English is a fun language
but that it's very small and compact in terms of characters, and simple to convert e.g. between cases
it fits well as a language to be transmitted and stored electronically
 
You only have to invent Unicode once for language to be easily transmitted and stored.
 
3:48 PM
nah, you have to invent Unicode
then you have to go beg your compiler vendor to invent Unicode support that doesn't blow
then you also have to hope that your text rendering API supports Unicode
 
Aka it already works.
 
maybe for your compiler vendor :(
I have to go use the Windows API to memory map my file to read it in without destroying newlines
 
@DeadMG (Since C++ doesn't support Unicode and the compiler vendor has no interest in providing an extension for that I'm considering e.g. ICU as part of the equation.)
@DeadMG I don't even.
 
lol
 
@DeadMG Why don't you read it in binary mode?
 
3:50 PM
Apparently I have a deadline set for tomorrow, even though I thought it was a week from now.
 
Why are you on chat?
 
I have written desktop tools for Windows and Mac that were translated in around 20 languages and I never found unicode to be problematic. I simply used UTF8 encoding (std::string) everywhere. Except when interfacing with the WinAPI, where I did a just-in-time conversion from/to UTF16.
 
@RMartinhoFernandes Excellent question. That I had not considered.
 
They didn't say it has to work perfectly.
 
3:52 PM
so, let me just clear up some confusion here
if I just read in a bunch of wchar_t from a file, and it's UTF-16 encoded, then I don't really need to deal with Unicode
right?
 
Wrong.
 
@DeadMG Depends what you do with it.
 
Unless you've got a multi-character sequence (or whatever its called) in the file
 
I knew you'd say thnat
 
Surrogate bitches.
 
3:53 PM
A surrogate pair.
 
the problem is, I really need to go character by character
 
Storing is fine, text manipulation isn't.
 
To do that, you have to decode it first.
 
so I can grab e.g. '\n'
 
@DeadMG If you walk it from one end to the other, that isn't difficult.
 
3:54 PM
File is an encoded bytestream, it doesn't have characters.
 
@CatPlusPlus You can't read a single character (char) from a UTF16 encoded stream?
 
You get characters by decoding.
 
Random access is impossible.
 
don't need random access
 
@StackedCrooked You can't read a single character from any kind of encoded stream.
 
3:55 PM
@DeadMG What do you do with it? Remove it?
 
You always need to decode it first.
 
no, I'm creating a lexer
 
@CatPlusPlus I mean reading a single char value.
 
Please let's not use the term character, it's really misleading here.
 
It's like asking if you can read a single character from gzip encoded stream.
 
3:55 PM
so I need to create data structures based on the content
 
@StackedCrooked wchar_t in this instance, no?
 
You can read a single byte, sure.
But it's meaningless until decoded.
 
so basically
 
@LucDanton I mean opening a text file that contains UTF16 text and reading chars.
 
if I want to deal with Unicode text remotely usefully, I need to grab ICU
because the Standard facilities aren't even close to adequate
 
3:56 PM
A real Unicode string is std::vector<unsigned int> storing decoded codepoints.
 
@StackedCrooked Binary manipulation then.
 
hmmm
 
@LucDanton I never thought about it. But how is '\n' different in UTF8 and UTF16?
 
all surrogate pairs have a specific value in their first value, right?
 
I'm okay with the Standard not saying anything about Unicode manipulation for the time being. I'd rather wait for a Boost library to come out so that we can refine the concept over time.
 
3:57 PM
Surely to lex a UTF-16 stream into your language, you can just move forward across the stream and deal with surrogate pairs, no?
 
yeah, I was just thinking that
but then I'd have to write my own surrogate-handling code
I guess that wouldn't be that tough
 
Maybe there's something on <cuchar>?
 
It's basic arithmetic, really.
 
@DeadMG Surrogate?
 
surely (logically), each surrogate would be one value saying "OHAI I'M A SURROGATE", and then one value saying "Ohai, I'm character X"
 
3:59 PM
Or somewhere else.
 
@DeadMG But why would you need to do any of that if you're just interested in locating a \n? You should be able to just iterate through the string 2 bytes at a time and look for that character
 
@StackedCrooked Well more to the point I think DeadMG was talking about manipulating wchar_t. You can indeed manipulate UTF-16 at the char level, like anything else. But like binary manipulation of anything else, you have to know what you're doing. I think that '\n' cannot appear in surrogate pairs of UTF-16 but I don't know much about that.
 
Codepoints from outside BMP are encoded into surrogate pairs.
It's a range.
 
@DeadMG: Your semantics are unclear. How many skirts is one woman wearing?
 
3:59 PM
U+D800..U+DFFF mark surrogate pairs.
 
I might be a little behind the times lol
 
@Praetorian Only if there are no surrogates being "\nSOMETHING"
 

« first day (362 days earlier)      last day (4593 days later) »