Why use fprintf?

fprintf call error because url encoding string have "%".
Merge pull request #1491 from tao-s/patch-2

Why use fprintf?