common: Use UTF-8 server encoding by default
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 19 Jun 2018 02:37:06 +0000 (21:37 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Jun 2018 21:59:39 +0000 (23:59 +0200)
commit8a86d4f72ff1d6f55c82b8f8fd5af3373d2e3f87
treea2ba63a362f74bbe32cb021a0ae69ea96f0d81d3
parent8a299aa68d09b6d210a8f69300b292d6ca4dad70
common: Use UTF-8 server encoding by default

Switch to UTF-8 as default codec for server.  This fixes non-ASCII
characters in /away messages and other situations silently being
converted to question marks.

Don't modify default Decoding codec as UTF-8 is automatically used
there when needed.

Update tooltips to offer guidance on restoring server encoding.

NOTE 1:  If client is upgraded without core being upgraded, client
will wrongly show UTF-8 as the default for server encoding.  The
older core still uses the past encoding, and manually specifying
UTF-8 as the selected encoding still works.

NOTE 2:  This affects all networks that have not yet set a custom
encoding.  A migration would require core-side in-database settings
versioning and reading/writing from database.  It might be better to
mention this on the release notes.

This is a matter of trade-offs.  Invalid encoding can result in error
messages or server disconnecting, confusing but noisy.  However, too
limited of an encoding simply silently converts characters to
question marks, in e.g. /away messages or nicks.  No warnings are
printed.

Is the IRC world ready for UTF-8 by default as a server encoding?

Well.. that's hard to say.  This can be overridden per-network
(even with an old client!), and this commit is also easily reverted.
It's probably worthwhile trying in beta, reverting before release if
too many things break.  IRC servers should at least provide error
messages.

(I personally think it's time to switch.  Partially since it took me
 1-2 years before finding out this is why I couldn't join UTF-8
 channels on a certain network.  And it's still confusing people
 today with e.g. non-ASCII in /away messages.)

Thanks to @disconsented for bringing this issue to attention again.

Test results for Freenode (a partially UTF-8 server network):
> Before
/join ##test♪
[8:18:31 pm] --> digitalcircuit (...) has joined ##test?
/nick digitalcircuit♪
[8:19:06 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:19:06 pm] * Nick digitalcircuit? contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:11 pm] * You have been marked as being away
/whois digitalcircuit
[8:21:18 pm] * [Whois] digitalcircuit is away: "Now playing ? Songs to Test"

> After
/join ##test♪
[8:16:57 pm] * 479 ##test♪ Illegal channel name
/nick digitalcircuit♪
[8:17:39 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:17:39 pm] * Nick digitalcircuit�� contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:46 pm] * You have been marked as being away
/whois digitalcircuit
[8:22:12 pm] * [Whois] digitalcircuit is away: "Now playing ♪ Songs to Test"
src/common/quassel.cpp
src/qtui/settingspages/networkssettingspage.ui