urlencode

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
raumi75
Posts: 135
Joined: Wed Dec 17, 2008 2:31 am
Location: Lünen, Germany
Contact:

urlencode

Post by raumi75 »

Hi there,

This is not exactly an hmg-question, but harbour in general. Is there a function like phps urlencode() (http://php.net/manual/en/function.urlencode.php?

this is the first time I use the hyperlink control. To link to other parts of my system that run on php in the web-browser, I set the address like this:

Code: Select all

window.lnk_tocustomer.address := "http://myserver.local/customers.php?custid="+trim(customers->id)
It works well with one exception. My Ids are not numeric, but type character. Sometimes they contain umlauts and other characters that need to be translated in order to work in a url. Is there an easy to use function in harbour that does that, or do I have to code it using strtran()?

Thanks for your suggestions!
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: urlencode

Post by Ricci »

With HMG4/HBQt you can use use: http://doc.qt.nokia.com/stable/qurl.htm ... ntEncoding

But in HMG3/Harbour ?
fprijatelj
Posts: 14
Joined: Wed Mar 10, 2010 4:09 pm

Re: urlencode

Post by fprijatelj »

Hi

There are functions :

tip_URLEncode(cStr)
tip_URLDecode(cStr)

LIBRARY: hbtip
mingw : libhbtip.a
msvc,bcc :hbtip.lib

Regards
Franček
User avatar
raumi75
Posts: 135
Joined: Wed Dec 17, 2008 2:31 am
Location: Lünen, Germany
Contact:

Re: urlencode

Post by raumi75 »

fprijatelj wrote: tip_URLEncode(cStr)
Hi Franček,

thanks a lot! That solved my problem.

At first, I was confused, because it does not work on hmg 3.0.35, yet. But I copied the lib from version 3.0.39. (I still use 3.0.35, because pgrdd does not run on later releases)

Is there a reference guide to all the functions? Or did you happen do know this one? Sometimes harbour feels like an iceberg. Most of it is hidden below the surface. ;)
Post Reply