Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder 12.5 GetUrl not working

Status
Not open for further replies.

beijc

Programmer
Oct 29, 2008
6
0
0
US
Hello, trying to convert an old Powerbuilder 7.0 system to the latest version. Don't know much about Powerbuilder. The conversion to the later system worked for the most part with not a lot of changes needed. However I have a problem with a call the system makes to the internet/url to retrieve data. It works with the 7.0 Powerbuilder but now with the 12.5. I put it in debug and stepped thru both versions. They seem to work exactly the same until it actually retrieves the data. The data retrieved with the 12.5 is actually chinese characters. This may be too confusing but any help would be greatly appreciated.

The call involves

Summary:

Variable definitions:

inet iinet_base
u_omni_data lu_omni_data

The code first issues 1) GetContextService("Internet", iinet_base)
2) lu_omni_data = Create u_omni_data
3) iinet_base.GETURL('the url to call', lu_omni_data)
4) ls_result_string = lu_omini_data.f_GetResultString()


After step 3, the geturl call the data is retrieved and contains gibberish.


The u_omni_data user object contains 2 functions
1) internetdata (blob data)

ii_length_data = LEN(data)
ii_result_data = String(data)

2) f_GetResultString which simply moves the retrieved data into variable fields.



LEN(data) returns the same value for both the old 7 version and the 12.5 version so i'm wondering if it's getting the correct results but somehow it's not readable?

String(data) is where I get the gibberish/chinese characters.
 
I actually found the solution to this on another post. The fix was to add EncodingAnsi! when moving the retrieved data into the string variable.

ls_data = String(data, EncodingAnsi!)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top