Display template in content search WebPart

Scenario: While adding content search web part in a page or page layout using all user web part. The selected display template while exporting web part is not retained the selection of custom display template and default display template gets selected if we create new page out of the page layout or page. I have verified couple of times in all user web part and it is correctly pointing to the display template like following
  1. ~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Test_Item_Contacts.js  


Solution: Found out the problem with ~ symbol and solution is to replace it with ASCII equivalent ~
  1. ~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Test_Item_Contacts.js