Replace all spaces in c-style string with '%20'