WPF SyntaxEditor doesn't handle selection of UTF-8 chars in strings in some cases

SyntaxEditor for WPF Forum

Posted 5 years ago by Johannes Turner - National Instruments Corporation
Version: 19.1.0681
Platform: .NET 3.0 (Core)
Environment: Windows 10 (64-bit)

The WPF SyntaxEditor control doesn't handle selecting certain UTF-8 chars in C-style strings.

Here are the steps to reproduce:

  1. Type one of the following strings in the SyntaxEditor component:
    • "𝕌𝕟𝕚𝕔𝕠𝕕𝕖"
    • "♥"
  2. Double-click the string literal inside the quotes ("") to create a selection.
  3. Notice that the editor selects the ending quote (") instead of the string literal itself.

The workaround is to create the selection manually, using the cursor caret.

PS: This is my first bug report, is there a way to subscribe to this bug report, so that I can get notified when or whether this bug will get fixed? Thanks!

[Modified 5 years ago]

Comments (1)

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Johannes,

Thank you for reporting this.  The word break finder (IWordBreakFinder) service is what determines how to locate words for a language.  If no custom IWordBreakFinder service is specified for the language, then an instance of DefaultWordBreakFinder is used by default.

The logic in DefaultWordBreakFinder will scan for a sequential range of letter or digit characters but it appears it wasn't handling surrogate pairs or some symbols properly.  We will improve this for the next maintenance release.

Actipro Software Support

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.