Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying and saving unicode data in VFP form
Message
 
 
To
25/12/2011 22:12:04
Jim Wiggins
Affordable Custom Software
Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01531674
Message ID:
01531676
Views:
214
>If you know the language of the data you want to display, you can set the FontCharSet property of a plain FoxPro text box in order to properly display the data. I doubt that there is a single font you can use for every language, but Tahoma can be used for quite few. Here are the choices with Tahoma:
>
>1 - Western
>178 - Arabic
>186 - Baltic
>238 - Central European
>204 - Cyrillic
>161- Greek
>177 - Hebrew
>222- Thai
>162 - Turkish
>163 - Vietnamese
>
>Jim Wiggins

No, I don't know the language in advance. I want the user to be able to pick up a language. I was trying to use the same code as suggested by Rick Strahl in his article. I could not find MS EditBox control, so I tried MS Forms 2 TextBox control. I took the value from SQL Server converted to varbinary (in SQL Server nvarchar(50)) and then I assign the text property of the control to the converted value
nodefault
set multilocks on					&&necessary for all types of buffering
cursorsetprop("MapBinary", .T., 0)
LOCAL lcSQL
TEXT TO lcSQL
SELECT pri_key      
      ,defltlang
      ,cast(language00 as varbinary(8000)) as language00
      ,lngimage00
      ,cast(language01 as varbinary(8000)) as language01
      ,lngimage01
      ,cast(language02 as varbinary(8000)) as language02
      ,lngimage02
      ,cast(language03 as varbinary(8000)) as language03
      ,lngimage03
      ,cast(language04 as varbinary(8000)) as language04
      ,lngimage04
      ,cast(language05 as varbinary(8000)) as language05
      ,lngimage05
      ,cast(language06 as varbinary(8000)) as language06
      ,lngimage06
      ,cast(language07 as varbinary(8000)) as language07
      ,lngimage07
      ,cast(language08 as varbinary(8000)) as language08
      ,lngimage08
      ,cast(language09 as varbinary(8000)) as language09
      ,lngimage09
      ,cast(language10 as varbinary(8000)) as language10
      ,lngimage10      
  FROM dbo.prefs_sl
endtext  
mysqlexec(m.lcSQL, 'prefs_sl', program())

select prefs_sl
if reccount()=0
  append blank 
ENDIF

SELECT pri_key, defltlang, ;
CAST(STRCONV(language00,10) as M) as language00, ;
CAST(STRCONV(language01,10) as M) as language01, ;
CAST(STRCONV(language02,10) as M) as language02, ;
CAST(STRCONV(language03,10) as M) as language03, ;
CAST(STRCONV(language04,10) as M) as language04, ;
CAST(STRCONV(language05,10) as M) as language05, ;
CAST(STRCONV(language06,10) as M) as language06, ;
CAST(STRCONV(language07,10) as M) as language07, ;
CAST(STRCONV(language08,10) as M) as language08, ;
CAST(STRCONV(language09,10) as M) as language09, ;
CAST(STRCONV(language10,10) as M) as language10, ;
lngImage00, ;
lngImage01, lngImage02, lngImage03, lngImage05, lngImage05, ;
lngImage06, lngImage07, lngImage08, lngImage09, lngImage10 ;
from prefs_sl into cursor prefs1_sl readwrite
However, it doesn't look correct.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform