Merge "Make ext-refs respect encoding flags." into nextgenv2