In chat conversations, my name appears as "Pierre-" when it should be "Pierre-Antoine" or at very least "Pierre".
Your name doesn't necessarily appear as "Pierre-"; that depends on the width of your browser window (and other issues like the font your browser uses, it's rendering engine, etc.)
These three screenshots of the same message were taken with no change other than changing the width of the window:
In Chrome 8 on my Windows 7 box, your user name appears as "Pierre-Antoine" in live chat when the window is about 1470 pixels wide.
Another thing to note is that there are actually two versions of your signature. If there's enough space (e.g. because you said several things in a row), you'll instead get this version:
– and in this case, it's clearly correct that the hyphen is on the first line.
Both versions of the signature use the browser's line breaking algorithm to determine what to show – in case of the small signature, everything but the first line is just hidden away from display.
So what to do? Unicode to the rescue!
We now consider a dash* in a username that is preceded and followed by neither another dash nor a whitespace character to be a hyphen, and we replace this dash with the corresponding unicode character.
- In the large signature, we use the regular hyphen,
‐. This doesn't change any line-breaking behavior, but is just for typographical consistency – a hyphen looks a little bit different from a regular dash, and we want the small and large versions of the signature to look equal.
- In the small signature, we instead use the sequence
​‑. This is a zero-width space, followed by a non-breaking hyphen. This little trick does exactly what we want – it puts the line break before, not after the hyphen.
* The correct name is actually Hyphen-Minus, codepoint U+002D – typographically speaking, a dash is a totally different beast.
** Note that we currently only do this in the live chat, not in the transcript.