@@ -66,16 +66,26 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu
6666 {
6767 var data = view . Process . ReadRemoteMemory ( ivalue , 64 ) ;
6868
69+ var isWideString = false ;
70+ string text = null ;
71+
6972 // First check if it could be an UTF8 string and if not try UTF16.
7073 if ( data . Take ( IntPtr . Size ) . InterpretAsSingleByteCharacter ( ) . IsPrintableData ( ) )
7174 {
72- var text = new string ( Encoding . UTF8 . GetChars ( data ) . TakeWhile ( c => c != 0 ) . ToArray ( ) ) ;
73- x = AddText ( view , x , y , view . Settings . TextColor , HotSpot . ReadOnlyId , $ "'{ text } '") + view . Font . Width ;
75+ text = new string ( Encoding . UTF8 . GetChars ( data ) . TakeWhile ( c => c != 0 ) . ToArray ( ) ) ;
7476 }
7577 else if ( data . Take ( IntPtr . Size * 2 ) . InterpretAsDoubleByteCharacter ( ) . IsPrintableData ( ) )
7678 {
77- var text = new string ( Encoding . Unicode . GetChars ( data ) . TakeWhile ( c => c != 0 ) . ToArray ( ) ) ;
78- x = AddText ( view , x , y , view . Settings . TextColor , HotSpot . ReadOnlyId , $ "L'{ text } '") + view . Font . Width ;
79+ isWideString = true ;
80+
81+ text = new string ( Encoding . Unicode . GetChars ( data ) . TakeWhile ( c => c != 0 ) . ToArray ( ) ) ;
82+ }
83+
84+ if ( text != null )
85+ {
86+ x = AddText ( view , x , y , view . Settings . TextColor , HotSpot . NoneId , isWideString ? "L'" : "'" ) ;
87+ x = AddText ( view , x , y , view . Settings . TextColor , HotSpot . ReadOnlyId , text ) ;
88+ x = AddText ( view , x , y , view . Settings . TextColor , HotSpot . NoneId , "'" ) + view . Font . Width ;
7989 }
8090 }
8191
0 commit comments