Return to Language Reference home pageHarbour API Explorer
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Only APIs with Curated Documentation are available from this screen.
Most API (functions) description comes from https://github.com/Petewg/harbour-core/wiki. Same content license applies.
To search all Harbour Core, Contribs and Packages APIs, including undocumented ones, go to Source Code Explorer.
Found 18 APIs
hb_cdpIsUTF8([<cCPID>]) ➔ <Logic>

Returns .T. if the current or the given <cCPID> code page is UTF8 otherwise returns .F.


hb_IsNull(<xExp>) ➔ <lResult>

Determines if the length of <xExp>, when is a string, an array or a hash, is zero ( Len() == 0 ).


hb_StrIsUTF8(<cString>) ➔ <lIsUTF8>

Returns .T. (true), if <cString> string is UTF-8 encoded. If <cString> is either not UTF-8 encoded or a NULL (empty) string, the function returns .F. (false)!


hb_strToUTF8(<cStr>,[<cCPID>]) ➔ <cUTF8Str>

Converts ("translate") <cStr> to UTF-8. It's similar to 'hb_Translate( cStr, cFromCPID, cToCPID )'.
<cCPID> is Harbour codepage id, f.e.: "EN", "ES", "ESWIN" in which <cStr> is currently encoded and will be used as basis for translation and if not given then default HVM codepage (set by hb_cdpSelect()) is used.


hb_utf8Asc(<cExp>) ➔ <nUTF8CharCode>

Same as 'Asc()' but applicable to UTF8 encoded text. Similar to 'hb_UCode()'.


hb_utf8At(<cSearchFor>,<cIntoString>,[<nStart>],<nEnd>) ➔ <nPosition | 0>

Same as 'hb_At()' but Unicode oriented.


hb_utf8Chr(<n>) ➔ <cUTF8Char>

Same as 'Chr()' but applicable to UTF8 encoded text.


hb_utf8Left(<cString>,<nCount>) ➔ <cSubString>

Same as 'Left()' but applicable to UTF8 encoded text.


hb_utf8Len(<cExp>) ➔ <nLen>

Same as 'Len()' but applicable to UTF8 encoded text.


hb_utf8Peek(<cText>,<n>) ➔ <nCode>

Returns UTF8 value of <n>-th character in given string.


hb_utf8Poke(<[@]cText>,<n>,<nVal>) ➔ <cText>

Replace <n>-th character in given string to UTF8 <nVal> one and return modified text.


hb_utf8RAt(<cSearchFor>,<cIntoString>,[<nStart>],[<nEnd>]) ➔ <nPosition>

Same as 'hb_RAt()' but applicable to UTF8 encoded text.


hb_utf8Right(<cString>,<nCount>) ➔ <cSubString>

Same as 'Right()' but applicable to UTF8 encoded text.


hb_utf8Stuff(<cString>,<nStart>,<nDelete>,<cInsert>) ➔ <cNewString>

Same as 'Stuff()' but applicable to UTF8 encoded text.


hb_utf8SubStr(<cString>,<nStart>,[<nCount>]) ➔ <cSubstring>

Same as 'SubStr()' but applicable to UTF8 encoded text.


hb_utf8ToStr(<cUTF8Str>,<cCPID>) ➔ <cStr>

It performs "translation" from UTF-8 to <cCPID> Harbour codepage id, f.e.: "EN", "ES", "ESWIN" etc.
<cUTF8Str> supposed to be a UTF-8 encoded string.
When <cCPID> is not given then the default HVM codepage (i.e. that set by hb_cdpSelect()) is used.


hb_utf8ToStrBox(<cUTF8String>) ➔ <cStringEncodedIn_GT_BOXCP>

It's needed because HB_UTF8TOSTR() will convert to main CP, but box drawing CP can be setup differently with HB_GTI_BOXCP, that function call will take that into account.


Len(<cString|aArray|hHash>) ➔ <nLength>

Returns the number of items contained in a string, array or hash. This means:

  • If argument passed is a string, returned value is the length of string in characters, if current codepage
    supports such functionality, (f.e., "UTF8EX" code-page does support it but "UTF8" does not!)
    So, the same string may have different number of characters with different encoding. (see 'this post' for more..)
  • If argument passed is an array or a hash table, returned value is the number of their elements.
  • If argument passed is empty, function returns 0 (zero).