EDIT: Sorry, I found documentation right within the settings.php file

I ran into a problem with database passwords recently as I was doing a scheduled security update.
After changing a password, I received a parse_url error which output the entire $db_url variable to browser.
After a little debugging, I found that special characters have problems.
Example:
If someone were to change their database password on an existing installation to 7ah?uC{QI4w/
it would break the website and throw the following error:

Warning: parse_url(mysql://username:7ah?uC{QI4w/@localhost/databasename) [function.parse-url]: Unable to parse URL in /public_html/includes/database.mysql.inc on line 52
Warning: Cannot modify header information - headers already sent by (output started at /public_html/includes/database.mysql.inc:52) in /public_html/includes/common.inc on line 148

This is only on exisiting installations as when the password is used during a fresh installation, the settings.php stores 7ah?uC{QI4w/ as 7ah%3FuC%7BQI4w%2F
$db_url = 'mysql://username:7ah%3FuC%7BQI4w%2F@localhost/databasename';

Has anyone ran into this issue before and is there any documentation?
Thanks