Forum Discussion

rushikesh's avatar
rushikesh
Contributor
8 years ago

File comparison is failing

Hi,

 

I am using Files.Compare functionality to compare two files.

 

Tested application supports English and Chinese language.

 

I use the code 

 

 

Log.Message(BaselinePath)
Log.Message(OutputPath)

if (!Files.Compare(BaselinePath,OutputPath))
{
Log.Error("File comparision failed")
} else
Log.Checkpoint("File comparision passed for tab ");

 

For English this works fine.

 

Problem is with Chinese language.

For Chinese, file being compared is having a Chinese name inside a Chinese folder.

When output the path using Log command then correct path is seen in log .

But Files.Compare fails for Chinese. In log says no item or file name present and ?? is seen in path in place of file and folder name which are in Chinese language.

 

Attached in log snapshot.

 

How to avoid this and compare files in such case also.

 

1 Reply

  • JuliaBernikova's avatar
    JuliaBernikova
    SmartBear Alumni (Retired)

    Hi,

     

    I created a folder with Chinese name and created there two text files with Chinese names as well. However, the code you provided worked correctly, the Files.Compare method didn't throw any errors. So, the problem seems to be specific to your machine. To get a resolution, please contact the support team so that they can thoroughly analyze the issue and help you.