Convert enum values in read attribute

Fix for issue #16459 and issue #14017 
@thedarkone Thanks for the explanation. I will make the necessary changes and resolve some other dependencies.