get encoding from system
move porcent() func to a closure