use constant for encoding
Merge pull request #10407 from NARKOZ/encoding-constant

Use constant for encoding