Topic: Bug ? TMemo Not Support UTF8

How to Fix script  load text  for support utf8 !

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
opendialog : topendialog ;
begin
opendialog := topendialog.create(form1) ;
if opendialog.execute then
form1.Memo1.Lines.loadfromfile(opendialog.filename);
opendialog.free
end;
begin
end.

https://s17.postimg.cc/kmn29p1hb/2018-04-12_19_21_42.png

Text Example(jp utf8.txt)

ももたろう Momotarou 
Momotarou, the Peach Boy 

ISBN4-591-03701-0 C8739 P1000E 

Translation by Tom Ray and Hiromi Mochizuki (hiromi@hip.atr.co.jp) ももたろう momotarou 

page 2 

むかし、 むかし、 ある ところ に 
おじいさん と おばあさん が いました。 
おじいさん が 山(やま) へ 木(き) を きり に いけば、 
おばあさん は 川(かわ) へ せんたく に でかけます。 
「おじいさん、 はよう もどって きなされ。」 
「おばあさん も き を つけて な。」 
まい日(にち) やさしく いい あって でかけます。
Post's attachments

Attachment icon load_text.zip 3.28 kb, 321 downloads since 2018-04-12 

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Bug ? TMemo Not Support UTF8

Unfortunately I can't change it.



When I open "jp utf8.txt" file in Notepad++, I see "Ansi as UTF-8", but when I do converting to UTF-8 (Enconding > Convert to UTF-8),  after that text displays correctly in MVD.

Dmitry.

Re: Bug ? TMemo Not Support UTF8

How to Fix 
Text Encode Go And Back
Ansi <> Unicode<>UTF8

Or Add TEncoding  Component Class ,Add Function For converter  ???
Because When to read string or Insert to database it false ...
Help Me please For Support more language !

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Bug ? TMemo Not Support UTF8

Please download latest beta version
https://www.dropbox.com/s/5x7vjreoju45z … a.zip?dl=0


Check it out:

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
    opendialog : topendialog ;
    sl: TStringList;
begin
    sl := TStringList.Create;

    opendialog := topendialog.create(form1) ;
    if opendialog.execute then
    begin
        sl.LoadFromFile(opendialog.FileName);
        Form1.Memo1.Text := sl.Text;
    end;
    opendialog.free;

    sl.Free;
end;
Dmitry.

Re: Bug ? TMemo Not Support UTF8

http://oi63.tinypic.com/or0x9i.jpg
OK Fix It Work!
Thank You...

UM... little Question It because Show false ?
- Component  in MVD not support
or
- Text File in my Pc

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: Bug ? TMemo Not Support UTF8

Both, this file actually not UTF-8, in the same time component can't detect it automatically.

Dmitry.