Search code examples
delphimultilingualrichedit

delphi 7 richedit and romanian language


I'm trying to write some Romanian text into a RichEdit component (Delphi 7) , and even i set the Font Property - Charset to "EASTEUROPE_CHARSET" it doesn't work.

What i want to accomplish is to paste some text (in romanian) in a RichEdit, load into a StringList, set the property order to true and assign it to another RichEdit component (sort the list in a alphabetical order).

I know this shouldn't be a problem in Delphi2009 and up, but at this point I can work only with Delphi 7.

word examples : opoziţie, computerizată.

Any ideas?

Best regards,


Solution

  • i've resolved it with JvWideEditor from Jedi. Code is bellow

    procedure TForm2.SortUnicode;
    var asrt:TWStringList;
        i:Integer;
    begin
     JvWideEditor1.Lines.Clear;
     JvWideEditor2.Lines.Clear;
     asrt:=TWStringList.Create;
     if OpenDialog1.Execute then
      begin
       wPath:=OpenDialog1.FileName;
       JvWideEditor1.Lines.LoadFromFile(wPath,[foUnicodeLB]);
       try
       asrt.AddStrings(JvWideEditor1.Lines);
       for i:=asrt.Count-1 downto 0 do 
        begin
          if Trim(asrt.Strings[i])='' then
           asrt.Delete(i);
        end;
       asrt.Duplicates:=dupAccept;
       asrt.CaseSensitive:=true;
       asrt.Sorted:=True;
    
       JvWideEditor2.Lines.AddStrings(asrt);
       JvWideEditor2.Lines.SaveToFile(GetCurrentDir+'\res.txt',[foUnicodeLB]);
       finally
        FreeAndNil(asrt);
       end;
      end;
    end;