A strange BUG about Richview using unicode~~~~

General TRichView support forum. Please post your questions here
Post Reply
cakk
Posts: 14
Joined: Thu Dec 17, 2009 2:35 am

A strange BUG about Richview using unicode~~~~

Post by cakk »

I think I found a BUG about TRichview.

I'm using Delphi 6.0.
Create a new project, place a TRichView and a TRVStyle onto the Form1, and set it support unicode as the help says. Then I add some unicode text to it, some text works fine, but some words do not work , It looks like the Richview "eats" some word...

eg: I add the word "Ñ¡Ôñ" to richview, it only shows "Ôñ".
Image

But, If I insert some other western letter before it, like "okÑ¡Ôñ", then it will be shown totally.
Image

Here is my unit1.pas:

Code: Select all

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, 
  Forms,  Dialogs, StdCtrls, RVStyle, RVScroll, RichView;
type
  TForm1 = class(TForm)
    RichView1: TRichView;
    RVStyle1: TRVStyle;
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
 Richview1.AddNLWTag(edit1.text,0,0,0);
 Richview1.Format;
end;
end.
And here is my unit1.dfm:

Code: Select all

object Form1: TForm1
  Left = 307
  Top = 133
  Width = 348
  Height = 155
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object RichView1: TRichView
    Left = 8
    Top = 8
    Width = 313
    Height = 81
    TabOrder = 0
    DoInPaletteMode = rvpaCreateCopies
    RTFReadProperties.UnicodeMode = rvruOnlyUnicode
    RTFReadProperties.TextStyleMode = rvrsAddIfNeeded
    RTFReadProperties.ParaStyleMode = rvrsAddIfNeeded
    RTFReadProperties.UseCharsetForUnicode = True
    RTFReadProperties.CharsetForUnicode = GB2312_CHARSET
    RVFOptions = [rvfoSavePicturesBody, rvfoSaveControlsBody, rvfoSaveBinary, rvfoSaveTextStyles, rvfoSaveParaStyles, rvfoSaveDocProperties, rvfoLoadDocProperties]
    Style = RVStyle1
  end
  object Button1: TButton
    Left = 8
    Top = 96
    Width = 75
    Height = 25
    Caption = 'Button1'
    TabOrder = 1
    OnClick = Button1Click
  end
  object Edit1: TEdit
    Left = 88
    Top = 96
    Width = 121
    Height = 21
    TabOrder = 2
    Text = 'Ñ¡Ôñ'
  end
  object RVStyle1: TRVStyle
    TextStyles = <
      item
        StyleName = 'Normal text'
        Charset = GB2312_CHARSET
        FontName = 'Arial'
        Unicode = True
      end>
    ParaStyles = <
      item
        StyleName = 'Paragraph Style'
        Tabs = <>
      end>
    ListStyles = <>
    StyleTemplates = <>
    Left = 104
    Top = 96
  end
end
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What version of TRichView?
Some old version of TRichView had a bug in displaying DBCS characters having bytes with code = 9.
cakk
Posts: 14
Joined: Thu Dec 17, 2009 2:35 am

Post by cakk »

TRichView 11.0.5
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please update to TRichView 12.
Post Reply