encode component and resource keys in utf-8