[SP-1254] - Regression PIR-994 - Fixed encoding issue with Metadata doma...

...in save. Cherry picked from f2981429e671a8f0b9de854566e81e115ec3f3ca