fix base string encoding with spaces