You could create some client side validation to check for spaces and more than one uppercase. That would be quite nice. Or you could give them a hint on the registration form.
Unfortunately, writing some custom code is beyond me. The question is, is bbPress converting the username or is it WP?
I just tried creating a user called “1 2 3” directly through WP and it converted the usersname to “1-2-3”.
Creating a username is pretty much the first interaction that people have with bbPress and the way it’s set up now there’s a highly probability of a problem. Even if they try to use a name like “John Smith” it’s not going to work. They’ll be unable to log in and most likely will give up and go away.
I tried to reproduce your issue but cannot, are you using any plugins that might cause this to be alter from the default WordPress 3.5.1 & bbPress 2.2.4/2.3 behaviour?
Create a user `1 2 3` via WordPress /wp-login.php?action=register
`ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.`
Create user `1 2 3` via bbPress widget/page template (page-user-register.php)
`Registration complete. Please check your e-mail.`
Confirmation email with username and password
Username:`1 2 3`
Via /wp-admin/user-edit.php user details are:
Username: `1 2 3` Nickname: `1 2 3` Display Name:`1 2 3`
Via phpMyAdmin `wp_users` database table:
user_login:`1 2 3` user_nicename: `1-2-3`display_name:`1 2 3`
To log in to bbPress using the either a page using the the page template page-user-login.php or the bbPress widget I must use the username `1 2 3`