I try to set up .hgrc file:
[ui]
username = MyName MySecondName <mymail@gmail.com>
I placed it under С:/Users/myusername/.hgrc
WHen I try
hg commit
or just
hg
I get following:

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It looks like your configuration file starts with a UTF-8 BOM (
0xEF 0xBB 0xBF). Removing that should fix the problem for starters, but might result in errors because AFAIK.hgrcis supposed to be in the default locale charset (not UTF-8).