Skip to content

DiffView control compare chinese text line is not good enough #137

Description

@hjy1210

In chinese text context, each character is a word, there is no space between words.

One expect difference between "台灣好" and "臺灣好" is only the first character "台" against "臺".

In my simple project, I got

DiffPlex

My code:
MainWindow.xaml

<Window x:Class="WpfAppDiffPlex.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:diffplex="clr-namespace:DiffPlex.Wpf.Controls;assembly=DiffPlex.Wpf"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid >
        <diffplex:DiffViewer x:Name="DiffView" FontSize="24"/>
    </Grid>
</Window>

MainWindow.xaml.cs

using System.Windows;

namespace WpfAppDiffPlex
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DiffView.OldText = "台灣好\n台 灣好\nTaiwan good";
            DiffView.NewText = "臺灣好\n臺 灣好\nTainan good";
        }
    }
}

How can I fix this problem? Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions