ported function convert_value() to the current master

The function has been commited with commits 7a08741, 807dfb8 and f94b98c and has been lost between release 2.0 and 2.05.