Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Eric de Haan
  Where is Eric de Haan?
 Alkmaar
 Netherlands
 Eric de Haan
 To: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 Tags
Subject: RE: VFP Unicode
Thread ID: 209249 Message ID: 233622 # Views: 49 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Saturday, July 04, 2009 10:08:04 AM         
   


> > 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.



COMPLETE THREAD
VFP Unicode Posted by mike castillo @ 12/26/2008 11:17:26 AM
RE: VFP Unicode Posted by Koen Piller @ 12/26/2008 11:48:29 AM
RE: VFP Unicode Posted by mike castillo @ 12/26/2008 1:41:50 PM
RE: VFP Unicode Posted by Yousfi Benameur @ 12/26/2008 11:30:21 PM
RE: VFP Unicode Posted by mike castillo @ 12/27/2008 2:26:19 AM
RE: VFP Unicode Posted by Erik Gomez @ 12/27/2008 1:58:44 AM
RE: VFP Unicode Posted by mike castillo @ 12/27/2008 2:28:21 AM
RE: VFP Unicode Posted by Samir Ibrahim @ 12/27/2008 6:27:29 PM
RE: VFP Unicode Posted by mike castillo @ 12/28/2008 1:57:54 AM
RE: VFP Unicode Posted by Yousfi Benameur @ 12/28/2008 1:25:12 AM
RE: VFP Unicode Posted by mike castillo @ 12/28/2008 1:59:26 AM
RE: VFP Unicode Posted by mike castillo @ 12/29/2008 7:39:25 AM
RE: VFP Unicode Posted by Yousfi Benameur @ 12/30/2008 2:29:16 PM
RE: VFP Unicode Posted by mike castillo @ 12/30/2008 3:26:13 PM
RE: VFP Unicode Posted by khubaib khalid @ 4/26/2009 7:23:55 PM
RE: VFP Unicode Posted by Bernard Bout @ 7/3/2009 1:39:42 AM
RE: VFP Unicode Posted by mike castillo @ 7/3/2009 5:27:49 AM
RE: VFP Unicode Posted by Eric de Haan @ 7/2/2009 1:07:36 PM
RE: VFP Unicode Posted by mike castillo @ 7/2/2009 5:34:18 PM
RE: VFP Unicode Posted by Eric de Haan @ 7/3/2009 9:49:20 AM
RE: VFP Unicode Posted by mike castillo @ 7/3/2009 10:10:25 AM
RE: VFP Unicode Posted by Eric de Haan @ 7/3/2009 10:24:47 AM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/3/2009 2:20:20 AM
RE: VFP Unicode Posted by Eric de Haan @ 7/4/2009 10:08:04 AM
RE: VFP Unicode Posted by khubaib khalid @ 7/6/2009 1:28:41 PM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/6/2009 5:46:14 PM
RE: VFP Unicode Posted by khubaib khalid @ 7/7/2009 3:39:52 PM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/7/2009 4:22:24 PM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/7/2009 7:46:04 PM
RE: VFP Unicode Posted by khubaib khalid @ 7/8/2009 11:13:57 AM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/8/2009 3:21:36 PM
RE: VFP Unicode Posted by mike castillo @ 7/3/2009 4:07:55 AM
RE: VFP Unicode Posted by Bernard Bout @ 7/3/2009 5:08:33 AM
RE: VFP Unicode Posted by mike castillo @ 7/3/2009 5:45:27 AM
RE: VFP Unicode Posted by Bernard Bout @ 7/3/2009 11:25:18 AM
RE: VFP Unicode Posted by Yousfi Benameur @ 7/3/2009 11:01:23 AM
RE: VFP Unicode Posted by Bernard Bout @ 7/3/2009 2:43:46 PM
RE: VFP Unicode Posted by khubaib khalid @ 7/8/2009 6:17:33 PM
RE: VFP Unicode Posted by Christof Wollenhaupt @ 7/6/2009 1:43:48 PM
RE: VFP Unicode Posted by Cesar @ 7/7/2009 12:24:04 AM
RE: VFP Unicode Posted by Sam @ 12/18/2009 4:40:15 AM