Index: doc/user-guide/commands.xml
===================================================================
--- doc/user-guide/commands.xml	(revision 0483e1e6e3954787058aff78223cb758f0074f2d)
+++ doc/user-guide/commands.xml	(revision 90254d0d6daa664707503f5c909198aefdc1151c)
@@ -1037,15 +1037,4 @@
 	</bitlbee-setting>
 
-	<bitlbee-setting name="lcnicks" type="boolean" scope="global">
-		<default>true</default>
-
-		<description>
-			<para>
-				Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.
-			</para>
-		</description>
-
-	</bitlbee-setting>
-
 	<bitlbee-setting name="local_display_name" type="boolean" scope="account">
 		<default>false</default>
@@ -1212,4 +1201,34 @@
 			</para>
 		</description>
+	</bitlbee-setting>
+
+	<bitlbee-setting name="nick_lowercase" type="boolean" scope="global">
+		<default>true</default>
+
+		<description>
+			<para>
+				If enabled, all nicknames are turned into lower case.
+			</para>
+
+			<para>
+				See also the <emphasis>nick_underscores</emphasis> setting. This setting was previously known as <emphasis>lcnicks</emphasis>.
+			</para>
+		</description>
+
+	</bitlbee-setting>
+
+	<bitlbee-setting name="nick_underscores" type="boolean" scope="global">
+		<default>true</default>
+
+		<description>
+			<para>
+				If enabled, spaces in nicknames are turned into underscores instead of being stripped.
+			</para>
+
+			<para>
+				See also the <emphasis>nick_lowercase</emphasis> setting.
+			</para>
+		</description>
+
 	</bitlbee-setting>
 
Index: irc.c
===================================================================
--- irc.c	(revision 0483e1e6e3954787058aff78223cb758f0074f2d)
+++ irc.c	(revision 90254d0d6daa664707503f5c909198aefdc1151c)
@@ -113,6 +113,7 @@
 	s = set_add(&b->set, "last_version", "0", NULL, irc);
 	s->flags |= SET_HIDDEN;
-	s = set_add(&b->set, "lcnicks", "true", set_eval_bool, irc);
 	s = set_add(&b->set, "nick_format", "%-@nick", NULL, irc);
+	s = set_add(&b->set, "nick_lowercase", "false", set_eval_bool, irc);
+	s = set_add(&b->set, "nick_underscores", "false", set_eval_bool, irc);
 	s = set_add(&b->set, "offline_user_quits", "true", set_eval_bool, irc);
 	s = set_add(&b->set, "ops", "both", set_eval_irc_channel_ops, irc);
Index: irc_channel.c
===================================================================
--- irc_channel.c	(revision 0483e1e6e3954787058aff78223cb758f0074f2d)
+++ irc_channel.c	(revision 90254d0d6daa664707503f5c909198aefdc1151c)
@@ -638,5 +638,5 @@
 	irc_channel_name_strip(name);
 
-	if (set_getbool(&irc->b->set, "lcnicks")) {
+	if (set_getbool(&irc->b->set, "nick_lowercase")) {
 		nick_lc(irc, name + 1);
 	}
Index: nick.c
===================================================================
--- nick.c	(revision 0483e1e6e3954787058aff78223cb758f0074f2d)
+++ nick.c	(revision 90254d0d6daa664707503f5c909198aefdc1151c)
@@ -94,5 +94,5 @@
 
 		nick_strip(irc, nick);
-		if (set_getbool(&bu->bee->set, "lcnicks")) {
+		if (set_getbool(&bu->bee->set, "nick_lowercase")) {
 			nick_lc(irc, nick);
 		}
@@ -215,4 +215,9 @@
 	if (ok && rets && *rets) {
 		nick_strip(irc, rets);
+
+		if (set_getbool(&bu->bee->set, "nick_lowercase")) {
+			nick_lc(irc, rets);
+		}
+
 		truncate_utf8(rets, MAX_NICK_LENGTH);
 		return rets;
@@ -288,4 +293,5 @@
 {
 	int len = 0;
+	gboolean nick_underscores = set_getbool(&irc->b->set, "nick_underscores");
 
 	if (irc && (irc->status & IRC_UTF8_NICKS)) {
@@ -297,6 +303,9 @@
 			n = g_utf8_find_next_char(p, NULL);
 
-			if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
-			                   strchr(nick_uc_chars, c))) ||
+			if (nick_underscores && c == ' ') {
+				*p = '_';
+				p = n;
+			} else if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
+			                          strchr(nick_uc_chars, c))) ||
 			    !g_unichar_isgraph(c)) {
 				strcpy(tmp, n);
@@ -313,5 +322,8 @@
 
 		for (i = len = 0; nick[i] && len < MAX_NICK_LENGTH; i++) {
-			if (strchr(nick_lc_chars, nick[i]) ||
+			if (nick_underscores && nick[i] == ' ') {
+				nick[len] = '_';
+				len++;
+			} else if (strchr(nick_lc_chars, nick[i]) ||
 			    strchr(nick_uc_chars, nick[i])) {
 				nick[len] = nick[i];
