Project: SWT
Bug 69814 [StyledText] Surrogate -- cannot delete a complete surrogate character in java editor using backspace
Reported: 2004-07-12 05:22:46 | Status: resolved fixed

Reporter: Huang Xing Jiang Language: Simplfied Chinese Build driver: eclipse-sourceBuild-srcIncluded-3.0M9 JDK Version: IBM JDK 1.41 Steps to recreate problem: 1. Open a text file in the text editor 2. Input a surrogate character \ud840\udc00 in the text file 2.Try to delete character \ud840\udc00 using backspace <<Error>> Only half of the character was deleted. Another half appears as blank in the text editor, you can select the character using keyboard or mouse, but cannot see it <<Expected Result>> The whole surrogate character \ud840\udc00 should be deleted <<Cause>> The text editor supposes that "Backspace" action will only delete "char" (16bit) in the editor, while surrogate character uses "two chars" (32 bit). <<Solution>> Modify "plugins\org.eclipse.swt\Eclipse SWT Custom Widgets\common\org\eclipse\swt\custom\StyledText.java" to take Backspace as a string cluster delete action

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java