> > Hi Mike,
> >
> > Can you tell me how you did that?
> > I have to save (and retrieve) polish text in a Windows Ansi environment and I can't get it to work.
> > I have use the MS Form TextBox to do the input. I can paste polish characters into the textbox and they are still visible as polish characters. But no matter what I do to save and retrieve it, I can't get it back in polish...
> >
> > Kind regard,
> > Eric
>
> I worked on this subject and give you my code below to show any international language reconized by windows.you can type in any language on the forms texbox who is unicode and save it to a txt file endcoded base 64.
> to retrieve the contain of this file in the textbox must decode the hexa encoded with strconv(its the only one stuff in visual foxpro).
> the zip below contains many texts in different languages encoded base 64 with strconv.these files are built with the forms textbox and saved to txt files (base 64).
>
> *--Author Yousfi Benameur El Bayadh Algeria
> *--Time stamp vendredi 3 juillet 2009; 00:17:48
> *--Subject :using Forms textbox unicode -multilanguages-
>
> PUBLIC oform1
> SET CLASSLIB TO "c:\program files\microsoft visual foxpro 9\ffc\_datanav.vcx" ADDITIVE
> oform1=NEWOBJECT("form1")
> oform1.Show
> release classlib "c:\program files\microsoft visual foxpro 9\ffc\_datanav.vcx"
> RETURN
>
> DEFINE CLASS form1 AS form
> Top = 6
> Left = 176
> Height = 403
> Width = 645
> ShowWindow = 2
> ShowTips = .T.
> Caption = "Load and save an unicode text in txt or cursor"
> Name = "form1"
>
> ADD OBJECT olecontrol1 AS olecontrol WITH ;
> oleclass="forms.textbox.1",;
> Top = 12, ;
> Left = 12, ;
> Height = 336, ;
> Width = 532, ;
> Name = "Olecontrol1"
>
> ADD OBJECT command5 AS commandbutton WITH ;
> Top = 156, ;
> Left = 555, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Paste", ;
> Name = "Command5"
>
>
> ADD OBJECT command6 AS commandbutton WITH ;
> Top = 185, ;
> Left = 555, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Copy", ;
> Name = "Command6"
>
> ADD OBJECT command7 AS commandbutton WITH ;
> Top = 360, ;
> Left = 120, ;
> Height = 27, ;
> Width = 96, ;
> Caption = "Save (txt hexa)", ;
> ToolTipText = "save to txt encoded hexa", ;
> Name = "Command7"
>
> ADD OBJECT command8 AS commandbutton WITH ;
> Top = 360, ;
> Left = 20, ;
> Height = 27, ;
> Width = 96, ;
> Caption = "Load txt(hexa)", ;
> ToolTipText = "Load a txt file encoded in 64-hexa", ;
> Name = "Command8"
>
> ADD OBJECT command10 AS commandbutton WITH ;
> Top = 125, ;
> Left = 556, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Select All", ;
> Name = "Command10"
>
> ADD OBJECT command13 AS commandbutton WITH ;
> Top = 96, ;
> Left = 552, ;
> Height = 27, ;
> Width = 91, ;
> Caption = "clear", ;
> Name = "Command13"
>
> ADD OBJECT commdlg AS olecontrol WITH ;
> oleclass="MScomDlg.commonDialog.1",;
> Top = 360, ;
> Left = 228, ;
> Height = 26, ;
> Width = 36, ;
> Name = "commdlg"
>
> ADD OBJECT command1 AS commandbutton WITH ;
> Top = 216, ;
> Left = 555, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Cut", ;
> Name = "Command1"
>
> ADD OBJECT _navbtns1 AS _navbtns WITH ;
> Top = 360, ;
> Left = 396, ;
> ToolTipText = "Navig cursor", ;
> Name = "_navbtns1", ;
> Vcrtop.Name = "Vcrtop", ;
> Vcrprevious.Name = "Vcrprevious", ;
> Vcrnext.Name = "Vcrnext", ;
> vcrbottom.Name = "vcrbottom"
>
> ADD OBJECT command4 AS commandbutton WITH ;
> Top = 252, ;
> Left = 552, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "brow cursor", ;
> Name = "Command4"
>
> ADD OBJECT command2 AS commandbutton WITH ;
> Top = 362, ;
> Left = 280, ;
> Height = 27, ;
> Width = 108, ;
> Caption = "Add text to cursor", ;
> ToolTipText = "add to cursor memo (hexa)", ;
> Name = "Command2"
>
> PROCEDURE Load
> xstart=getwordnum(getwordnum(sys(16),2,'.'),2," ")+'.sct'
> xstart=justpath(xstart)
>
> if directory(xstart)
> set defa to (xstart)
> endi
>
> =SYS(3101,65001)
>
> create cursor ycurs (texte M)
> gnbre=adir(gabase,"*.txt")
> for i=1 to gnbre
> insert into ycurs values(filetostr(gabase(i,1)))
> endfor
> *brow
>
> ENDPROC
> PROCEDURE INIT
> dodefault()
> sele ycurs
> locate
> thisform.olecontrol1.text=strconv(texte,14)
> ENDPROC
>
> PROCEDURE olecontrol1.Init
> this.multiline=.t.
> this.scrollbars=3
> this.textAlign=3
> this.IMEmode=0
> *this.font.name="Arial unicode"
> this.font.size=14
> this.forecolor=rgb(0,0,255)
> *=COMPROP(this,"UTF8",1)
> ENDPROC
>
>
> PROCEDURE command5.Click
> thisform.olecontrol1.setfocus()
> oshell=createObject("wscript.shell")
> oshell.sendkeys("^{v}")
> ENDPROC
>
>
> PROCEDURE command6.Click
> thisform.olecontrol1.setfocus()
> oshell=createObject("wscript.shell")
> oShell.sendkeys("^{A}")
> oshell.sendkeys("^{c}")
> ENDPROC
>
>
> PROCEDURE command7.Click
> with thisform.commDlg
> .CancelError = .t.
> .filter="txt|*.txt"
> .showSave()
> =strtofile(strconv(thisform.olecontrol1.text,13),.filename)
> endwith
> ENDPROC
>
>
> PROCEDURE command8.Click
> thisform.olecontrol1.text=strconv(filetostr(getfile('txt')),14)
> ENDPROC
>
>
> PROCEDURE command10.Click
> thisform.olecontrol1.setfocus()
> oshell=createObject("wscript.shell")
> oshell.sendkeys("^{A}")
> ENDPROC
>
> PROCEDURE command13.Click
> thisform.olecontrol1.text=""
> ENDPROC
>
> PROCEDURE command1.Click
> thisform.olecontrol1.setfocus()
> oshell=createObject("wscript.shell")
> oshell.sendkeys("^{X}")
> ENDPROC
>
> PROCEDURE _navbtns1.Vcrtop.Click
> dodefault()
> thisform.olecontrol1.text=strconv(texte,14)
> ENDPROC
>
> PROCEDURE _navbtns1.Vcrprevious.Click
> dodefault()
> thisform.olecontrol1.text=strconv(texte,14)
> ENDPROC
>
> PROCEDURE _navbtns1.Vcrnext.Click
> dodefault()
> thisform.olecontrol1.text=strconv(texte,14)
> ENDPROC
>
>
> PROCEDURE _navbtns1.vcrbottom.Click
> dodefault()
> thisform.olecontrol1.text=strconv(texte,14)
> ENDPROC
>
> PROCEDURE command4.Click
> sele ycurs
> brow
> ENDPROC
>
> PROCEDURE command2.Click
> insert into ycurs values (strconv(thisform.olecontrol1.text,13))
> messagebox("added",0+32)
> ENDPROC
>
> ENDDEFINE
> *
> *-- EndDefine: form1
>
> the zip contains 1 form and a prg (same) and txt international languages.
>
http://www.foxite.com/uploads/5879b701-ba71-4cbc-a975-822079dfe675.zip>
> the form is like a small workshop like this photo:
>

>
> NB: Copy (ctrl+c),paste(ctrl+v),cut (ctrl+x),select all (ctrl+A).
>
> Dont rate please.its only for the pleasure to help.Give me only a feed back.
> Yousfi Benameur
thank you.