Use index to look up encoding.
Use index to look up encoding.

Summary: We can now perform a simple lookup to find the encoding.

Reviewed By: yuxuanchen1997

Differential Revision: D37775176

fbshipit-source-id: b7802ce00719a4cc1a4beccc2a3ca3717a06acd2

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex