added encoding directive support