Hi, i’m running a comparison on two different docx files with Turkish locale (CurrentCulture and CurrentUICulture) set on the main thread. When I do so the following exception is thrown from GroupDocs Comparison. It appears as though an enum is being parsed with Turkish locale which is causing an exception due to the letter ‘i’ not being equal to the character in the enum definition.
Hello Lars,
Hi, we’re running Groupdocs.Web.UI.Comparison.dll v 2.3.3.0 on .NET 4.5.2 together with WebForms. Here’s our code running the comparison. You can use any documents you like. It does not seem to matter.
private ComparisonWidgetSettings GetComparisonSettings()
{
return new ComparisonWidgetSettings
{
LicensePath = this.licensePath,
RootStoragePath = this.tempFolderPath,
ComparisonBehavior =
{
StyleChangesDetection = false, // This feature do not seem to work at the moment - bug reported to GroupDocs [2015-05-04] ~ PW
MovedContentDetection = false, // This feature is turned off due to lack of time to test its impact on CPU, and the result it produces ~ PW
SummaryPageGenerationEnabled = false, // This feature is turned off because the summary page cannot be localized, it’s been noted as a feature request [2015-05-04] ~ PW
VectorBasedPdfComparison = false
}
};
}
public Stream Compare(<font face="Consolas"><span style="font-size: 11px; background-color: white;">byte[] oldestDoc, </span></font>byte[] newestDoc)
{
var comparisonService = new ComparisonService(GetComparisonSettings());
var differenceStream = new MemoryStream();
using (var oldestDataStream = new MemoryStream(oldestDoc))
using (var newestDataSteam = new MemoryStream(newestDoc))
{
comparisonService.SourceFileName(oldestDoc.FileName, oldestDataStream);
comparisonService.TargetFileName(newestDoc.FileName, newestDataSteam);
comparisonService.Compare();
comparisonService.Save(differenceStream);
}
return differenceStream;
}</pre></div>
Hello,
Thank you for the code example. We have checked Comparison with two docx document with turkish text and your code doesn’t throw any exception.
Also we have compared same documents in a common way and it works well too.
The only thing that we have add to your code is this code line:
GroupdocsComparison.Init(GetComparisonSettings());
Just after:
var comparisonService = new ComparisonService(GetComparisonSettings());
Summarizing all these we can assume that the issue reason is in your files, since that we really need them for testing.
Thank you.
I’m sorry for my previous statement that the files do not matter. They do. The problem only occurs if the newer version (i.e. SourceFile) has additions. I have included a proper Visual Studio project with code and sample files. If you comment the lines adding Turkish locale, the comparison works just fine.
Hello,