[utils] Add missing mode and encoding arguments