PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

roberval
Usuário Nível 1
Usuário Nível 1
Mensagens: 19
Registrado em: 08 Out 2019 10:48
Localização: maringa/pr

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por roberval »

Olá pessoal
Estou integrando com uma API, onde tenho q enviar um pdf convertendo pra base64, no entanto, no xHarbour 1.2.1, não funciona.
entrei em contato com suporte, me falaram q não estava em utf8

mesmo codigo no Harbour 3.2.0, usando função hb_base64encoder (não tem essa função no xHarbour) ... foi de boa.. sem problemas..

alguma luz sobre isso ?

Agradecido.. abraços
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por JoséQuintas »

PDF é binário, não tem nada a ver com usar UTF-8 nele.
base64 também não depende de UTF-8.
Não sei se poderia ser um bug, se for, talvez pensar em atualizar o xharbour pra versão mais nova.
Não trabalho com xharbour, não sei mais detalhes, por exemplo, se precisaria alterar codepage só pra conversão.
Também não sei se pode ter a ver com compilador bcc/mingw, se tratam diferente isso.
Esses seriam os testes que eu faria:
- sobre codepage do programa interferir nisso
- sobre compilador bcc/mingw
- sobre bug corrigido em xharbour mais novo

Convém lembrar que tem LIB que corrige coisas, mas fica só na lib.
Pode entrar nos testes juntar alguma lib gráfica fivewin,minigui,etc. que pode ter isso corrigido.
Quem não tiver esse problema, é bom mencionar a lib gráfica que usa.

Como última opção, pensar no harbour, só pra essa rotina ou não.

Faça testes só com xharbour isolado também, vai que alguma lib ao invés de corrigir estrague, o teste isolado pode ajudar nisso.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
roberval
Usuário Nível 1
Usuário Nível 1
Mensagens: 19
Registrado em: 08 Out 2019 10:48
Localização: maringa/pr

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por roberval »

Oi José.obrigado pela ajuda

falei do pdf, mas é xml.. no entando terei q enviar pdf tbém..

já uso o Harbour pra integrar com ssl, não consegui nessa versão do xharbour

vou acabar fazendo com harbour mesmo.. nem perder tempo em testar no desatualizado..

estou tentando migrar todo o sistema pra harbour.. mas é complexo demais.. temos muito codigo proprio.. milhares e milhares de linhas..

quase inviavel.. so na compilação aparece centenas de erros.. imagina na execução kkkkk

abraço
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por Itamar M. Lins Jr. »

.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por JoséQuintas »

De jeito nenhum faça isso.

Procure concentrar as diferenças em um novo fonte, talvez renomeando algumas funções.
Faça isso com o aplicativo em uso, sem fonte alternativo.
Talvez já usar as funções do harbour, que geralmente tem outro nome, assim facilita no fonte.

Exemplo:

Xharbour tem um MemoWrite() com parâmetro adicional.
No harbour é o hb_MemoWrite()

O mais seguro seria passar a usar hb_MemoWrit() e criar essa função no xHarbour.
Não vai alterar o funcionamento dos seus fontes atuais, e pode fazer com segurança.

Ao invés de:

Código: Selecionar todos

MemoWrit( cfile, ctexto, .T. )
usar

Código: Selecionar todos

hb_MemoWrit( cFile, cTexto )
e cria a função substituta

Código: Selecionar todos

FUNCTION hb_MemoWrit( cFile, cTexto )
   MemoWrit( cFile, cTexto, .T. )
   RETURN Nil
Vantagem?
Seu fonte fica pronto pra harbour e xharbour.
Pode compilar com xharbour e usar sem problema.
Também pode compilar com harbour, apenas não incluindo o fonte dessa função.

Seus fontes sempre em uso, funcionando normalmente, sempre atualizados, e preparados pra algum dia compilar com harbour.

Melhor do que ficar criando versões paralelas, e perder o uso porque fez muitas mudanças no fonte original e o paralelo se perdeu.

E melhor do que encher de #ifdef __XHARBOUR__ nos fontes.

O principal: a biblioteca de compatibilidade é problemática, pode criar mais problemas do que solução.


Eu lembro muito bem de sefazclass enfrentar problemas com xharbour, e também com a biblioteca de compatibilidade.
A biblioteca de compatibilidade cria incompatibilidades com o próprio harbour.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por Itamar M. Lins Jr. »

Olá!
Pronto! Apaguei a msg... Já que não é pra fazer...
Vai que um doido igual a mim, faça é dê certo... ai vai ter que provar, isso e aquilo outro...
Pra quem tem tempo pra ficar rodando fonte de PRG em dois tipos de Harbours x LIBS gráficas, etc... Ficar comparando isso com aquilo outro...
Com compiladores A,B,C...
O meu padrão é o que rodar no Windows e Linux já tá de bom tamanho.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
roberval
Usuário Nível 1
Usuário Nível 1
Mensagens: 19
Registrado em: 08 Out 2019 10:48
Localização: maringa/pr

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por roberval »

oi Itamar

kkkkkkk agora fiquei curioso... manda a msg ai... pra eu ter certeza q sou louco e continuo pobre..

não tenho nem adjetivo pra definir nossa empresa, além de 'morta, já enterrada, só falta fazer cimento e colocar a lapide..

infelizmente..
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por Itamar M. Lins Jr. »

Olá!
Eu só postei, que quando fiz isso, lá atras, que usei muito o xHarbour (diferente) de outros...
Usei a lib de compatibilidade do xHarbour na pasta \contrib\xhb(do harbour)
Tem um arquivo lá chamado hbcompat.ch, basicamente tem todoas as funções do xHarbour, confesso que usava poucas. mas acredito que tem todas.

Código: Selecionar todos

#ifdef __HARBOUR__

#include "hbgtinfo.ch"
#include "hbgfx.ch"

#ifdef __XHARBOUR__

   #if defined( __PLATFORM__Windows ) .AND. ! defined( __PLATFORM__WINDOWS )
      #define __PLATFORM__WINDOWS
   #endif
   #if defined( __PLATFORM__Linux ) .AND. ! defined( __PLATFORM__LINUX )
      #define __PLATFORM__LINUX
   #endif

   #xtranslate hb_gtInfo( HB_GTI_INKEYREAD [, <x>] )   => SetInkeyBeforeBlock( [<x>] ) <-x->
   #xtranslate hb_gtInfo( HB_GTI_INKEYFILTER [, <x>] ) => SetInkeyAfterBlock( [<x>] ) <-x->

   #xtranslate hb_ScrMaxRow()                  => gtInfo( HB_GTI_SCREENHEIGHT )
   #xtranslate hb_ScrMaxCol()                  => gtInfo( HB_GTI_SCREENWIDTH )
   #xtranslate MaxRow( .T. )                   => gtInfo( HB_GTI_SCREENHEIGHT )
   #xtranslate MaxCol( .T. )                   => gtInfo( HB_GTI_SCREENWIDTH )
   #xtranslate hb_keyNext( [<x>] )             => NextKey( <x> )

   #xtranslate hb_osNewLine()                  => hb_eol()
   #xtranslate hb_osPathSeparator()            => hb_ps()

   #xtranslate hb_dbPack()                     => __dbPack()
   #xtranslate hb_dbZap()                      => __dbZap()
   #xtranslate hb_dbDrop( [<x,...>] )          => dbDrop( <x> )
   #xtranslate hb_dbExists( [<x,...>] )        => dbExists( <x> )
   #xtranslate hb_FieldLen( [<x>] )            => FieldLen( <x> )
   #xtranslate hb_FieldDec( [<x>] )            => FieldDec( <x> )
   #xtranslate hb_FieldType( [<x>] )           => FieldType( <x> )

   #xtranslate hb_processOpen( [<x,...>] )     => hb_OpenProcess( <x> )
   #xtranslate hb_processClose( [<x,...>] )    => hb_CloseProcess( <x> )

   #xtranslate hb_IsRegex( [<x>] )             => hb_IsRegexString( <x> )
   #xtranslate hb_MethodName( [<x,...>] )      => MethodName( <x> )
   #xtranslate hb_libLoad( [<x,...>] )         => LibLoad( <x> )
   #xtranslate hb_libFree( [<x,...>] )         => LibFree( <x> )
   #xtranslate hb_Adler32( [<x,...>] )         => hb_Checksum( <x> )
   #xtranslate hb_keySetLast( [<x,...>] )      => hb_SetLastKey( <x> )
   #xtranslate hb_CStr( [<x,...>] )            => CStr( <x> )
   #xtranslate hb_ValToExp( [<x,...>] )        => ValToPrgExp( <x> )
   #xtranslate hb_rddInfo( [<x,...>] )         => rddInfo( <x> )
   #xtranslate hb_idleSleep( [<x,...>] )       => SecondsSleep( <x> )
   #xtranslate hb_UserName()                   => NetName( 1 )
   #xtranslate hb_FSize( <x> )                 => FileSize( <x> )
   #xtranslate hb_WildMatch( [<x,...>] )       => WildMatch( <x> )
   #xtranslate hb_bitTest( [<x,...>] )         => hb_bitIsSet( <x> )
   #xtranslate hb_Deserialize( <x> )           => hb_DeserialNext( <x> )

   #xtranslate hb_HexToNum( [<c,...>] )        => HexToNum( <c> )
   #xtranslate hb_NumToHex( [<n,...>] )        => NumToHex( <n> )
   #xtranslate hb_HexToStr( [<c,...>] )        => HexToStr( <c> )
   #xtranslate hb_StrToHex( [<c,...>] )        => StrToHex( <c> )

   #xtranslate hb_AScan( [<x,...>] )           => AScan( <x> )
   #xtranslate hb_RAScan( [<x,...>] )          => RAScan( <x> )
   #xtranslate hb_AIns( [<x,...>] )            => AIns( <x> )
   #xtranslate hb_ADel( [<x,...>] )            => ADel( <x> )
   #xtranslate hb_At( [<x,...>] )              => At( <x> )

   #xtranslate hb_DateTime( [<x,...>] )        => DateTime( <x> )
   #xtranslate hb_Hour( [<x>] )                => Hour( <x> )
   #xtranslate hb_Minute( [<x>] )              => Minute( <x> )
   #xtranslate hb_TToS( [<x>] )                => TToS( <x> )
   #xtranslate hb_SToT( [<x>] )                => SToT( <x> )
   #xtranslate hb_TToC( [<x,...>] )            => TToC( <x> )
   #xtranslate hb_CToT( [<x,...>] )            => CToT( <x> )

   #xtranslate hb_GetEnv( [<x,...>] )          => GetEnv( <x> )
   #xtranslate hb_SetKey( [<x,...>] )          => SetKey( <x> )

   #xtranslate hb_i18n_gettext( <x> )          => i18n( <x> )

   #xtranslate hb_cdpSelect( [<x,...>] )       => hb_SetCodepage( <x> )

   #xtranslate hb_argv( [<x,...>] )            => hb_CmdArgArgV( <x> )

   #xtranslate hb_PIsByRef( @<!localVar!> )    => hb_IsByRef( @<localVar> )

   #xtranslate hb_iniSetComment( [<x,...>] )   => hb_SetIniComment( <x> )
   #xtranslate hb_iniRead( [<x,...>] )         => hb_ReadIni( <x> )
   #xtranslate hb_iniWrite( [<x,...>] )        => hb_WriteIni( <x> )

   #xtranslate hb_DisableWaitLocks( [<x>] )    => DisableWaitLocks( <x> )

   #xtranslate hb_gtLock()                     => hbConsoleLock()
   #xtranslate hb_gtUnlock()                   => hbConsoleUnlock()

   /* MT functions */
   #xtranslate hb_mtvm()                       => hb_MultiThread()
   #xtranslate hb_threadSelf()                 => GetCurrentThread()
   #xtranslate hb_threadID( [<x,...>] )        => GetThreadId( <x> )
   #xtranslate hb_threadStart( <x,...> )       => StartThread( [<x>] )
   #xtranslate hb_threadJoin( <x> )            => JoinThread( <x> )
   #xtranslate hb_threadQuitRequest( <x> )     => KillThread( <x> )
   #xtranslate hb_threadWaitForAll()           => WaitForThreads()
   #xtranslate hb_threadTerminateAll()         => KillAllThreads()

   #xtranslate hb_mutexNotify( <x,...> )       => Notify( <x> )
   #xtranslate hb_mutexNotifyAll( <x,...> )    => NotifyAll( <x> )

   #xtranslate hb_mutexSubscribe( <x,...> )    => {| mtx, nTimeOut, xSubscribed | ;;
                                                  LOCAL lSubscribed ;;
                                                  xSubscribed := Subscribe( mtx, ;
                                                                            iif( HB_ISNUMERIC( nTimeOut ), nTimeOut * 1000, ), ;
                                                                            @lSubscribed ) ;
                                                  RETURN lSubscribed ; }:eval( <x> )
   #xtranslate hb_mutexSubscribeNow( <x,...> ) => {| mtx, nTimeOut, xSubscribed | ;;
                                                  LOCAL lSubscribed ;;
                                                  xSubscribed := SubscribeNow( mtx, ;
                                                                               iif( HB_ISNUMERIC( nTimeOut ), nTimeOut * 1000, ), ;
                                                                               @lSubscribed ) ;
                                                  RETURN lSubscribed ; }:eval( <x> )

   #xtranslate hb_mutexLock( <x>, <n> )        => iif( ! HB_ISNUMERIC( <n> ), hb_mutexLock( <x> ) ;
                                                     iif( <n> <= 0, hb_MutexTryLock( <x> ), ;
                                                        hb_MutexTimeOutLock( <x>, <n> ) ) )

   /* Hash item functions */
   #xtranslate hb_Hash( [<x,...>] )            => Hash( <x> )
   #xtranslate hb_HHasKey( [<x,...>] )         => HHasKey( <x> )
   #xtranslate hb_HPos( [<x,...>] )            => HGetPos( <x> )
   #xtranslate hb_HGet( [<x,...>] )            => HGet( <x> )
   #xtranslate hb_HSet( [<x,...>] )            => HSet( <x> )
   #xtranslate hb_HDel( [<x,...>] )            => HDel( <x> )
   #xtranslate hb_HKeyAt( [<x,...>] )          => HGetKeyAt( <x> )
   #xtranslate hb_HValueAt( [<x,...>] )        => HGetValueAt( <x> )
   #xtranslate hb_HValueAt( [<x,...>] )        => HSetValueAt( <x> )
   #xtranslate hb_HPairAt( [<x,...>] )         => HGetPairAt( <x> )
   #xtranslate hb_HDelAt( [<x,...>] )          => HDelAt( <x> )
   #xtranslate hb_HKeys( [<x,...>] )           => HGetKeys( <x> )
   #xtranslate hb_HValues( [<x,...>] )         => HGetValues( <x> )
   #xtranslate hb_HFill( [<x,...>] )           => HFill( <x> )
   #xtranslate hb_HClone( [<x,...>] )          => HClone( <x> )
   #xtranslate hb_HCopy( [<x,...>] )           => HCopy( <x> )
   #xtranslate hb_HMerge( [<x,...>] )          => HMerge( <x> )
   #xtranslate hb_HEval( [<x,...>] )           => HEval( <x> )
   #xtranslate hb_HScan( [<x,...>] )           => HScan( <x> )
   #xtranslate hb_HCaseMatch( [<x,...>] )      => HGetCaseMatch( <x> )
   #xtranslate hb_HAutoAdd( [<x,...>] )        => HGetAutoAdd( <x> )
   #xtranslate hb_HAllocate( [<x,...>] )       => HAllocate( <x> )
   #xtranslate hb_HDefault( [<x,...>] )        => HDefault( <x> )
   #if defined( HB_LEGACY_LEVEL5 )
   #xtranslate hb_HSetCaseMatch( [<x,...>] )   => HSetCaseMatch( <x> )
   #xtranslate hb_HSetAutoAdd( [<x,...>] )     => HSetAutoAdd( <x> )
   #endif

   /* Inet functions */
   #xtranslate hb_inetInit( [<x,...>] )                => inetInit( <x> )
   #xtranslate hb_inetCleanup( [<x,...>] )             => inetCleanup( <x> )
   #xtranslate hb_inetCreate( [<x,...>] )              => inetCreate( <x> )
   #xtranslate hb_inetClose( [<x,...>] )               => inetClose( <x> )
   #xtranslate hb_inetFD( [<x,...>] )                  => inetFD( <x> )
   #xtranslate hb_inetstatus( [<x,...>] )              => inetStatus( <x> )
   #xtranslate hb_inetErrorCode( [<x,...>] )           => inetErrorCode( <x> )
   #xtranslate hb_inetErrorDesc( [<x,...>] )           => inetErrorDesc( <x> )
   #xtranslate hb_inetClearError( [<x,...>] )          => inetClearError( <x> )
   #xtranslate hb_inetCount( [<x,...>] )               => inetCount( <x> )
   #xtranslate hb_inetAddress( [<x,...>] )             => inetAddress( <x> )
   #xtranslate hb_inetPort( [<x,...>] )                => inetPort( <x> )
   #xtranslate hb_inetTimeout( <x>, <y> )              => inetSetTimeout( <x>, <y> )
   #xtranslate hb_inetTimeout( <x> )                   => inetGetTimeout( <x> )
   #xtranslate hb_inetClearTimeout( [<x,...>] )        => inetClearTimeout( <x> )
   #xtranslate hb_inetTimeLimit( <x>, <y> )            => inetSetTimeLimit( <x>, <y> )
   #xtranslate hb_inetTimeLimit( <x> )                 => inetGetTimeLimit( <x> )
   #xtranslate hb_inetClearTimeLimit( [<x,...>] )      => inetClearTimeLimit( <x> )
   #xtranslate hb_inetPeriodCallback( <x>, <y> )       => inetSetPeriodCallback( <x>, <y> )
   #xtranslate hb_inetPeriodCallback( <x> )            => inetGetPeriodCallback( <x> )
   #xtranslate hb_inetClearPeriodCallback( [<x,...>] ) => inetClearPeriodCallback( <x> )
   #xtranslate hb_inetRecv( [<x,...>] )                => inetRecv( <x> )
   #xtranslate hb_inetRecvAll( [<x,...>] )             => inetRecvAll( <x> )
   #xtranslate hb_inetRecvLine( [<x,...>] )            => inetRecvLine( <x> )
   #xtranslate hb_inetRecvEndblock( [<x,...>] )        => inetRecvEndBlock( <x> )
   #xtranslate hb_inetDataReady( [<x,...>] )           => inetDataReady( <x> )
   #xtranslate hb_inetSend( [<x,...>] )                => inetSend( <x> )
   #xtranslate hb_inetSendAll( [<x,...>] )             => inetSendAll( <x> )
   #xtranslate hb_inetGetHosts( [<x,...>] )            => inetGetHosts( <x> )
   #xtranslate hb_inetGetAlias( [<x,...>] )            => inetGetAlias( <x> )
   #xtranslate hb_inetServer( [<x,...>] )              => inetServer( <x> )
   #xtranslate hb_inetAccept( [<x,...>] )              => inetAccept( <x> )
   #xtranslate hb_inetConnect( [<x,...>] )             => inetConnect( <x> )
   #xtranslate hb_inetConnectIP( [<x,...>] )           => inetConnectIP( <x> )
   #xtranslate hb_inetDGramBind( [<x,...>] )           => inetDGramBind( <x> )
   #xtranslate hb_inetDGram( [<x,...>] )               => inetDGram( <x> )
   #xtranslate hb_inetDGramSend( [<x,...>] )           => inetDGramSend( <x> )
   #xtranslate hb_inetDGramRecv( [<x,...>] )           => inetDGramRecv( <x> )
   #xtranslate hb_inetCRLF( [<x,...>] )                => inetCRLF( <x> )
   #xtranslate hb_inetIsSocket( [<x,...>] )            => inetIsSocket( <x> )
   #xtranslate hb_inetClose( [<x,...>] )               => inetDestroy( <x> )

   /* Some statement endings */
   #xcommand ENDSEQUENCE => END
   #xcommand ENDSWITCH => END
   #xcommand END SWITCH => END
   #xcommand ENDWITH => END
   #xcommand END WITH => END
   #xcommand END OBJECT => END

   #ifndef HB_SYMBOL_UNUSED
      #define HB_SYMBOL_UNUSED( symbol )  ( symbol := ( symbol ) )
   #endif

   #define HB_GTI_CLIPBOARDPASTE HB_GTI_CLIPBOARDPAST

#else

   #if defined( __PLATFORM__WINDOWS ) .AND. ! defined( __PLATFORM__Windows )
      #define __PLATFORM__Windows
   #endif
   #if defined( __PLATFORM__LINUX ) .AND. ! defined( __PLATFORM__Linux )
      #define __PLATFORM__Linux
   #endif

   /* these are used _by_ MaxRow()/MaxCol() */
   #define GTI_WINDOW         0  /* Maximum window size ('window' in CT terms) */
   #define GTI_SCREEN         1  /* Maximum screen size ('Screen' in CT terms) */
   #define GTI_CLIENT         2  /* Maximum possible client size of a window */
   #define GTI_MAX            3  /* Maximum possible window size (in Windows) */

   #xtranslate hb_eol()                        => hb_osNewLine()
   #xtranslate hb_ps()                         => hb_osPathSeparator()

   #xtranslate MaxRow( .T. )                   => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT )
   #xtranslate MaxCol( .T. )                   => hb_gtInfo( HB_GTI_VIEWPORTWIDTH )
   #xtranslate NextKey( [<x>] )                => hb_keyNext( <x> )

   #xtranslate Str( <x>, <n>, <d>, <l> )       => iif( <l>, LTrim( Str( <x>, <n>, <d> ) ), Str( <x>, <n>, <d> ) )
   #xtranslate Str( <x>, <n>,, <l> )           => iif( <l>, LTrim( Str( <x>, <n> ) ), Str( <x>, <n> ) )
   #xtranslate Str( <x>,,, <l> )               => iif( <l>, hb_ntos( <x> ), Str( <x> ) )

   #xuntranslate NetName(                      =>
   #xuntranslate MemoWrit(                     =>

   #xtranslate NetName( <n> )                  => iif( HB_ISNUMERIC( <n> ) .AND. <n> == 1, hb_UserName(), NetName() )
   #xtranslate MemoWrit( <x>, <y>, <z> )       => iif( HB_ISLOGICAL( <z> ) .AND. ! <z>, hb_MemoWrit( <x>, <y> ), MemoWrit( <x>, <y> ) )

   #xuntranslate AIns(                         =>
   #xuntranslate ADel(                         =>

   #xtranslate AIns( <a>, <n>, [<x,...>] )     => hb_AIns( <a>, <n>, <x> )
   #xtranslate ADel( <a>, <n>, <l> )           => hb_ADel( <a>, <n>, <l> )

   #xtranslate AScan(<a>,<b>,[<c>],[<d>],<e>)  => hb_AScan( <a>, <b>, <c>, <d>, <e> )
   #xtranslate At( <a>, <b>, [<x,...>] )       => hb_At( <a>, <b>, <x> )

   #xtranslate GetEnv( [<x,...>] )             => hb_GetEnv( <x> )
   #xtranslate SetKey( [<x,...>] )             => hb_SetKey( <x> )

   /* TEXT INTO <varname> */
   #xcommand TEXT INTO <v> => #pragma __text|<v>+=%s+hb_eol();<v>:=""

   /* SWITCH ... ; case ... ; DEFAULT ; ... ; END */
   #xcommand DEFAULT => OTHERWISE

   /* FOR EACH hb_enumIndex() */
   #xtranslate hb_enumIndex( <!v!> ) => <v>:__enumIndex()

   /* TRY / CATCH / FINALLY / END */
   #xcommand TRY => BEGIN SEQUENCE WITH __BreakBlock()
   #xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
   #xcommand FINALLY => ALWAYS

   /* EXTENDED CODEBLOCKs */
   #xtranslate \<|[<x,...>]| => {| <x> |
   #xcommand > [<*x*>]       => } <x>

   /* xHarbour operators: IN, HAS, LIKE, >>, <<, |, &, ^^ */
   #translate ( <exp1> IN <exp2> )     => ( ( <exp1> ) $ ( <exp2> ) )
   #translate ( <exp1> HAS <exp2> )    => ( hb_regexHas( <exp2>, <exp1> ) )
   #translate ( <exp1> LIKE <exp2> )   => ( hb_regexLike( <exp2>, <exp1> ) )
   #translate ( <exp1> \<\< <exp2> )   => ( hb_bitShift( <exp1>, <exp2> ) )
   #translate ( <exp1> >> <exp2> )     => ( hb_bitShift( <exp1>, -( <exp2> ) ) )
   /* NOTE: These macros can break some valid Harbour/Clipper constructs,
            so they are disabled by default. Enable them with care, or
            even better to switch to use HB_BIT*() functions directly.
            They are optimized by Harbour compiler the same way (and even
            more) as these C-like operators, without any bad side-effects. */
   #if defined( XHB_BITOP )
      #translate ( <exp1> | <exp2> )      => ( xhb_bitOr( <exp1>, <exp2> ) )
      #translate ( <exp1> & <exp2> )      => ( xhb_bitAnd( <exp1>, <exp2> ) )
      #translate ( <exp1> ^^ <exp2> )     => ( xhb_bitXor( <exp1>, <exp2> ) )
   #endif

   #command @ <row>, <col> PROMPT <prompt> [ MESSAGE <msg> ] [ COLOR <color> ] => ;
      __AtPrompt( <row>, <col>, <prompt>, <msg>, <color> )

   #command SET TRIMFILENAME <x:ON,OFF,&> => Set( _SET_TRIMFILENAME, <(x)> )
   #command SET TIME FORMAT [TO] <f>      => Set( _SET_TIMEFORMAT, <f> )

   #define HB_GTI_CLIPBOARDPAST HB_GTI_CLIPBOARDPASTE

   /* These also have wrapper function in xhb lib */

   #xtranslate gtSetClipboard( <x> )           => hb_gtInfo( HB_GTI_CLIPBOARDDATA, <x> )
   #xtranslate gtGetClipboard()                => hb_gtInfo( HB_GTI_CLIPBOARDDATA )
   #xtranslate gtGetClipboardSize()            => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) )
   #xtranslate gtPasteClipboard()              => hb_gtInfo( HB_GTI_CLIPBOARDPASTE )
   #xtranslate gtProcessMessages()             => NextKey()
   #xtranslate SetInkeyBeforeBlock( [<x>] )    => hb_gtInfo( HB_GTI_INKEYREAD [, <x>] ) <-x->
   #xtranslate SetInkeyAfterBlock( [<x>] )     => hb_gtInfo( HB_GTI_INKEYFILTER [, <x>] ) <-x->
   #xtranslate GfxPrimitive( [<x,...>] )       => hb_gfxPrimitive( <x> )
   #xtranslate GfxText( [<x,...>] )            => hb_gfxText( <x> )

   #xtranslate hb_OpenProcess( [<x,...>] )     => hb_processOpen( <x> )
   #xtranslate hb_CloseProcess( [<x,...>] )    => hb_processClose( <x> )

   #xtranslate hb_IsRegexString( [<x>] )       => hb_IsRegex( <x> )
   #xtranslate MethodName( [<x,...>] )         => hb_MethodName( <x> )
   #xtranslate LibLoad( [<x,...>] )            => hb_libLoad( <x> )
   #xtranslate LibFree( [<x,...>] )            => hb_libFree( <x> )
   #xtranslate hb_Checksum( [<x,...>] )        => hb_Adler32( <x> )
   #xtranslate hb_SetLastKey( [<x,...>] )      => hb_keySetLast( <x> )
   #xtranslate CStr( [<x,...>] )               => hb_CStr( <x> )
   #xtranslate ValToPrgExp( [<x,...>] )        => hb_ValToExp( <x> )
   #xtranslate SecondsSleep( [<x,...>] )       => hb_idleSleep( <x> )
   #xtranslate WildMatch( [<x,...>] )          => hb_WildMatch( <x> )
   #xtranslate hb_bitIsSet( [<x,...>] )        => hb_bitTest( <x> )
   #xtranslate hb_DeserialNext( <x> )          => hb_Deserialize( <x> )
   #xtranslate hb_FuncPtr( <x> )               => __dynsN2Sym( <x> )

   #xtranslate HexToNum( [<c,...>] )           => hb_HexToNum( <c> )
   #xtranslate NumToHex( [<n,...>] )           => hb_NumToHex( <n> )
   #xtranslate HexToStr( [<c,...>] )           => hb_HexToStr( <c> )
   #xtranslate StrToHex( [<c,...>] )           => hb_StrToHex( <c> )

   #xtranslate IsPointer( <xValue> )           => HB_ISPOINTER( <xValue> )

   #xtranslate hb_SetIniComment( [<x,...>] )   => hb_iniSetComment( <x> )
   #xtranslate hb_ReadIni( [<x,...>] )         => hb_iniRead( <x> )
   #xtranslate hb_WriteIni( [<x,...>] )        => hb_iniWrite( <x> )

   #xtranslate DisableWaitLocks( [<x>] )       => hb_DisableWaitLocks( <x> )

   #xtranslate hbConsoleLock()                 => hb_gtLock()
   #xtranslate hbConsoleUnlock()               => hb_gtUnlock()

   #xtranslate hb_CmdArgArgV( [<x,...>] )      => hb_argv( <x> )

   #xtranslate hb_IsByRef( @<!localVar!> )     => hb_PIsByRef( @<localVar> )

   #xtranslate RAScan( [<x,...>] )             => hb_RAScan( <x> )

   #xtranslate ASizeAlloc( <a> [, <n,...>] )   => AFill( <a> )
   #xtranslate ALenAlloc( <a> [, <n,...>] )    => Len( <a> )

   #xtranslate DateTime( [<x,...>] )           => hb_DateTime( <x> )
   #xtranslate Hour( [<x>] )                   => hb_Hour( <x> )
   #xtranslate Minute( [<x>] )                 => hb_Minute( <x> )
   #xtranslate TToS( [<x>] )                   => hb_TToS( <x> )
   #xtranslate SToT( [<x>] )                   => hb_SToT( <x> )
   #xtranslate TToC( [<x,...>] )               => hb_TToC( <x> )
   #xtranslate CToT( [<x,...>] )               => hb_CToT( <x> )

   #xtranslate i18n( <x> )                     => hb_i18n_gettext( <x> )

   #xtranslate hb_SetCodepage( [<x,...>] )     => hb_cdpSelect( <x> )

   /* MT functions */
   #xtranslate hb_MultiThread()                => hb_mtvm()
   #xtranslate GetCurrentThread()              => hb_threadSelf()
   #xtranslate GetThreadId( [<x,...>] )        => hb_threadID( <x> )
   #xtranslate ThreadGetCurrentInternal()      => hb_threadID()
   #xtranslate IsSameThread( <x> [,<y>] )      => ( hb_threadID( <x> ) == hb_threadID( <y> ) )
   #xtranslate IsValidThread( <x> )            => ( hb_threadID( <x> ) != 0 )
   #xtranslate JoinThread( <x> )               => hb_threadJoin( <x> )
   #xtranslate KillThread( <x> )               => hb_threadQuitRequest( <x> )
   #xtranslate StopThread( <x> )               => hb_threadQuitRequest( <x> ); hb_threadJoin( <x> )
   #xtranslate KillAllThreads()                => hb_threadTerminateAll()
   #xtranslate WaitForThreads()                => hb_threadWaitForAll()

   #xtranslate ThreadSleep( <x> )              => hb_idleSleep( <x> / 1000 )

   #xtranslate DestroyMutex( <x> )             =>
   #xtranslate hb_MutexTryLock( <x> )          => hb_mutexLock( <x>, 0 )
   #xtranslate hb_MutexTimeOutLock( <x> )      => hb_mutexLock( <x>, 0 )
   #xtranslate hb_MutexTimeOutLock( <x>, <n> ) => hb_mutexLock( <x>, iif( HB_ISNUMERIC( <n> ), <n> / 1000, 0 ) )

   #xtranslate Notify( <x,...> )               => hb_mutexNotify( <x> )
   #xtranslate NotifyAll( <x,...> )            => hb_mutexNotifyAll( <x> )
   #xtranslate Subscribe( <x,...> )            => {| mtx, nTimeOut, lSubscribed | ;;
                                                   local xSubscribed ;;
                                                   lSubscribed := hb_mutexSubscribe( mtx, ;
                                                                                     iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ;
                                                                                     @xSubscribed ) ;
                                                   return xSubscribed ; }:eval( <x> )
   #xtranslate SubscribeNow( <x,...> )         => {| mtx, nTimeOut, lSubscribed | ;;
                                                   local xSubscribed ;;
                                                   lSubscribed := hb_mutexSubscribeNow( mtx, ;
                                                                                        iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ;
                                                                                        @xSubscribed ) ;
                                                   return xSubscribed ; }:eval( <x> )

   #xtranslate StartThread( [<x>] )            => hb_threadStart( <x> )
   #xtranslate StartThread( <x>, <y> [, <z,...>] ) => iif( HB_ISOBJECT( <x> ) .AND. HB_ISSTRING( <y> ), ;
                                                           hb_threadStart( {| ... | ( <x> ):&( <y> )( ... ) } [, <z>] ), ;
                                                           hb_threadStart( <x>, <y> [, <z>] ) )

   /* not possible to well replicate xHarbour behavior because it's buggy
      these function results are different on different platform, chosen
      translation which returns compatible types (numeric) */
   #xtranslate ThreadGetCurrent()              => hb_threadID()
   #xtranslate GetSystemThreadId( [<x,...>] )  => hb_threadID( <x> )

   /* do not need translation */
   /* hb_mutexCreate()                         => hb_mutexCreate() */
   /* hb_mutexUnlock( <x> )                    => hb_mutexUnlock( <x> ) */

   /* do not need translation only when xHarbour code is compiled by Harbour */
   /* hb_mutexLock( <x> )                      => hb_mutexLock( <x> ) */

   /* functions I do not want to document as public .prg API in Harbour */
   /* ThreadInspect() */
   /* ThreadInspectEnd() */
   /* ThreadIsInspect() */

   /* functions which are not necessary in Harbour */
   /* hb_ThreadGetTryErrorArray() */
   /* ThreadIdleFence() */

   /* function which I can add but it's not very usable in real life */
   /* hb_ThreadCountStacks() */

   /* Hash item functions */
   #xtranslate Hash( [<x,...>] )           => hb_Hash( <x> )
   #xtranslate HHasKey( [<x,...>] )        => hb_HHasKey( <x> )
   #xtranslate HGetPos( [<x,...>] )        => hb_HPos( <x> )
   #xtranslate HGet( [<x,...>] )           => hb_HGet( <x> )
   #xtranslate HSet( [<x,...>] )           => hb_HSet( <x> )
   #xtranslate HDel( [<x,...>] )           => hb_HDel( <x> )
   #xtranslate HGetKeyAt( [<x,...>] )      => hb_HKeyAt( <x> )
   #xtranslate HGetValueAt( [<x,...>] )    => hb_HValueAt( <x> )
   #xtranslate HSetValueAt( [<x,...>] )    => hb_HValueAt( <x> )
   #xtranslate HGetPairAt( [<x,...>] )     => hb_HPairAt( <x> )
   #xtranslate HDelAt( [<x,...>] )         => hb_HDelAt( <x> )
   #xtranslate HGetKeys( [<x,...>] )       => hb_HKeys( <x> )
   #xtranslate HGetValues( [<x,...>] )     => hb_HValues( <x> )
   #xtranslate HFill( [<x,...>] )          => hb_HFill( <x> )
   #xtranslate HClone( [<x,...>] )         => hb_HClone( <x> )
   #xtranslate HCopy( [<x,...>] )          => hb_HCopy( <x> )
   #xtranslate HMerge( [<x,...>] )         => hb_HMerge( <x> )
   #xtranslate HEval( [<x,...>] )          => hb_HEval( <x> )
   #xtranslate HScan( [<x,...>] )          => hb_HScan( <x> )
   #xtranslate HSetCaseMatch( <x>[, <z>] ) => ( hb_HCaseMatch( <x>[, <z>] ), <x> )
   #xtranslate HGetCaseMatch( [<x,...>] )  => hb_HCaseMatch( <x> )
   #xtranslate HSetAutoAdd( <x>[, <z>] )   => ( hb_HAutoAdd( <x>[, <z>] ), <x> )
   #xtranslate HGetAutoAdd( [<x,...>] )    => hb_HAutoAdd( <x> )
   #xtranslate HAllocate( [<x,...>] )      => hb_HAllocate( <x> )
   #xtranslate HDefault( [<x,...>] )       => hb_HDefault( <x> )
   #xtranslate HSetPartition( [<x,...>] )  =>

   /* Associative hash array functions */
   #xtranslate haAGetKeyAt( [<x,...>] )    => hb_HKeyAt( <x> )
   #xtranslate haAGetValueAt( [<x,...>] )  => hb_HValueAt( <x> )
   #xtranslate haADelAt( [<x,...>] )       => hb_HDelAt( <x> )
   #xtranslate haAGetPos( [<x,...>] )      => hb_HPos( <x> )
   #xtranslate haAGetRealPos( <x>, <y> )   => iif( HB_ISNUMERIC( <y> ) .AND. <y> >= 1 .AND. ;
                                                   Int( <y> ) <= Len( <x> ), Int( <y> ), 0 )
   #xtranslate HGetVAAPos( <x> )           => {| h | ;;
                                                LOCAL a := Array( Len( h ), v ;;
                                                FOR EACH v IN a ;;
                                                   v := v:__enumIndex() ;;
                                                NEXT ;;
                                                RETURN a ; }:eval( <x> )
   #xtranslate HGetAACompatibility( <x> )  => hb_HKeepOrder( <x> )
   #xtranslate HSetAACompatibility( [<x,...>] ) => {| h | ;;
                                                   hb_HKeepOrder( h, .T. ) ;;
                                                   RETURN .T. ; }:eval( <x> )

   /* inet*() functions */
   #xtranslate inetInit( [<x,...>] )                => hb_inetInit( <x> )
   #xtranslate inetCleanup( [<x,...>] )             => hb_inetCleanup( <x> )
   #xtranslate inetCreate( [<x,...>] )              => hb_inetCreate( <x> )
   #xtranslate inetClose( [<x,...>] )               => hb_inetClose( <x> )
   #xtranslate inetFD( [<x,...>] )                  => hb_inetFD( <x> )
   #xtranslate inetStatus( [<x,...>] )              => hb_inetstatus( <x> )
   #xtranslate inetErrorCode( [<x,...>] )           => hb_inetErrorCode( <x> )
   #xtranslate inetErrorDesc( [<x,...>] )           => hb_inetErrorDesc( <x> )
   #xtranslate inetClearError( [<x,...>] )          => hb_inetClearError( <x> )
   #xtranslate inetCount( [<x,...>] )               => hb_inetCount( <x> )
   #xtranslate inetAddress( [<x,...>] )             => hb_inetAddress( <x> )
   #xtranslate inetPort( [<x,...>] )                => hb_inetPort( <x> )
   #xtranslate inetSetTimeout( [<x,...>] )          => hb_inetTimeout( <x> )
   #xtranslate inetGetTimeout( [<x,...>] )          => hb_inetTimeout( <x> )
   #xtranslate inetClearTimeout( [<x,...>] )        => hb_inetClearTimeout( <x> )
   #xtranslate inetSetTimeLimit( [<x,...>] )        => hb_inetTimeLimit( <x> )
   #xtranslate inetGetTimeLimit( [<x,...>] )        => hb_inetTimeLimit( <x> )
   #xtranslate inetClearTimeLimit( [<x,...>] )      => hb_inetClearTimeLimit( <x> )
   #xtranslate inetSetPeriodCallback( [<x,...>] )   => hb_inetPeriodCallback( <x> )
   #xtranslate inetGetPeriodCallback( [<x,...>] )   => hb_inetPeriodCallback( <x> )
   #xtranslate inetClearPeriodCallback( [<x,...>] ) => hb_inetClearPeriodCallback( <x> )
   #xtranslate inetRecv( [<x,...>] )                => hb_inetRecv( <x> )
   #xtranslate inetRecvAll( [<x,...>] )             => hb_inetRecvAll( <x> )
   #xtranslate inetRecvLine( [<x,...>] )            => hb_inetRecvLine( <x> )
   #xtranslate inetRecvEndBlock( [<x,...>] )        => hb_inetRecvEndblock( <x> )
   #xtranslate inetDataReady( [<x,...>] )           => hb_inetDataReady( <x> )
   #xtranslate inetSend( [<x,...>] )                => hb_inetSend( <x> )
   #xtranslate inetSendAll( [<x,...>] )             => hb_inetSendAll( <x> )
   #xtranslate inetGetHosts( [<x,...>] )            => hb_inetGetHosts( <x> )
   #xtranslate inetGetAlias( [<x,...>] )            => hb_inetGetAlias( <x> )
   #xtranslate inetServer( [<x,...>] )              => hb_inetServer( <x> )
   #xtranslate inetAccept( [<x,...>] )              => hb_inetAccept( <x> )
   #xtranslate inetConnect( [<x,...>] )             => hb_inetConnect( <x> )
   #xtranslate inetConnectIP( [<x,...>] )           => hb_inetConnectIP( <x> )
   #xtranslate inetDGramBind( [<x,...>] )           => hb_inetDGramBind( <x> )
   #xtranslate inetDGram( [<x,...>] )               => hb_inetDGram( <x> )
   #xtranslate inetDGramSend( [<x,...>] )           => hb_inetDGramSend( <x> )
   #xtranslate inetDGramRecv( [<x,...>] )           => hb_inetDGramRecv( <x> )
   #xtranslate inetCRLF( [<x,...>] )                => hb_inetCRLF( <x> )
   #xtranslate inetIsSocket( [<x,...>] )            => hb_inetIsSocket( <x> )
   #xtranslate inetDestroy( [<x,...>] )             => iif( hb_inetIsSocket( <x> ), hb_inetClose( <x> ), )

   /* Throw() => generate error */
   #xtranslate Throw( <oErr> ) => ( Eval( ErrorBlock(), <oErr> ), Break( <oErr> ) )

#endif

#endif /* __HARBOUR__ */
Basta linkar ela no seu app e voialà!!! tá feito!
E depois eu fui tirando 1 por uma. É só usar a função do Harbour equivalente.
Isso pq (eu fui) o primeiro a usar o HB3.4 do Viktor, e ele não recomendava usar algumas dessas dai por conta de bugs... (~pensa que não sei ;-) )
Tudo é questão de tempo e testes básicos. Eu fiz assim, já não tenho mais nenhuma.(acredito) nem sei.
Eu quero é que funcione!

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
roberval
Usuário Nível 1
Usuário Nível 1
Mensagens: 19
Registrado em: 08 Out 2019 10:48
Localização: maringa/pr

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por roberval »

maravilha... muito bom ... valeu mesmo.. vou ver isso..

abraço
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por JoséQuintas »

Sim, mas a conversão de antigamente não era a mesma de agora.
A própria biblioteca de compatibilidade não tinha tudo que tem hoje.
Não dá pra considerar a minha conversão ou a sua como referência.
Harbour e Xharbour evoluíram, há muito mais coisas que podem ser diferentes.

O ideal é como falei: mantenha o fonte em uso, não crie versão alternativa.
Se vai usar #ifdef __XHARBOUR__ ou não tanto faz.
Apenas se centralizar tudo em um único lugar, vai ter referência, menos trabalho, e vai poder trabalhar com os fontes originais sempre.

Depois de tudo concluído E FUNCIONANDO, aí sim, pode mandar ver e alterar radical.

Não se esqueça: dependendo da lib ela altera as coisas.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por JoséQuintas »

Veja minha compoilação normal, com gtwvg, fivewin e hwgui.
d:\fontes\integra>d:\fontes\util\build\build.exe

d:\fontes\integra>HBMK2 JPA.HBP -w3 -es2 -m -n -strip -compr -workdir=c:\temp -q -Id:\fontes\util\build\
hbmk2: Processing environment options: -comp=mingw
hbmk2: Processing configuration: d:\harbour\bin\hbmk.hbc
Harbour 3.2.0dev (r2501210845)
Copyright (c) 1999-2024, https://harbour.github.io/
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehg.lib(errsysw.o):errsysw.c:(.text+0x3a): multiple definition of `HB_FUN_ERRORSYS'; c:/temp/errorsys.o:errorsys.c:(.text+0x40): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehg.lib(errsysw.o):errsysw.c:(.text+0x1a2): multiple definition of `HB_FUN_HB_GTSYS'; c:/temp/jpa.o:jpa.c:(.text+0xe0): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehg.lib(printer.o):printer.c:(.text+0x580): multiple definition of `HB_FUN_PRINTBEGIN'; d:/fontes/integra/libjpa/lib\liblibjpa.a(ze_print.o):(.text+0x0): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehg.lib(printer.o):printer.c:(.text+0x5da): multiple definition of `HB_FUN_PRINTEND'; d:/fontes/integra/libjpa/lib\liblibjpa.a(ze_print.o):(.text+0x20): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehgc.lib(msgs.o):msgs.c:(.text+0x4c2): multiple definition of `HB_FUN_MSGSTOP'; d:/fontes/integra/libjpa/lib\liblibjpa.a(ze_messagebox.o):(.text+0x60): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehgc.lib(msgs.o):msgs.c:(.text+0x4ec): multiple definition of `HB_FUN_MSGYESNO'; d:/fontes/integra/libjpa/lib\liblibjpa.a(ze_messagebox.o):(.text+0x0): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/fivewin/lib\fivehgc.lib(strtoken.o):strtoken.c:(.text+0x15c): multiple definition of `HB_FUN_STRTOKEN'; d:/harbour/lib/win/mingw\libhbmisc.a(stringsx.o):(.text+0x80): first defined here
d:/harbour/comp/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.0.0/../../../../i686-w64-mingw32/bin/ld.exe: d:/github/hwgui/lib\libhwgui.a(nice.o):(.text+0x250): multiple definition of `Gradient'; d:/github/fivewin/lib\fivehgc.lib(brushes.o):brushes.c:(.text+0xd10): first defined here
collect2.exe: error: ld returned 1 exit status
hbmk2[JPA]: Error: Running linker. 1
São funções duplicadas.

A maioria é normal, mas StrToken()..... tem no fivewin e tem no harbour.
Será que é diferente ? será que foi criada pro xharbour ? sei lá....

Errorsys é normal, só uso a minha, duplica com quase todas as libs, porque elas forçam o uso da delas.
MsgStop() e MsgYesNo() é comum, toda lib tem
PrintBegin() e PrintEnd(), tenho no meu aplicativo, fivewin também, mas uso pra matriciais, fivewin usa pra impressão windows.

É desse tipo que coisa que comento sobre LIBs poderem causar interferência.
BLINKER não avisa isso, vai compilar sempre em silêncio.
MINGW avisa.
No caso eu coloco pro mingw aceitar duplicado, e tudo bem, com o cuidado das minhas funções entrarem primeiro.

Se Isso acontecer na mudança de harbour/xharbour ou xharbour/harbour, pode dar a impressão errada sobre algum problema, porque nunca se sabe qual vai entrar primeiro, e se funciona do mesmo jeito.

Nota: Gradient() tem em hwgui e fivewin, até agora não deu problema, mas ainda não fiz uso disso.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por JoséQuintas »

Um acréscimo nisso:

Nem sempre dá alerta de função duplicada.
Isso só acontece quando existe um conjunto de funções com ela no meio.

uma LIB tem A e C
outra LIB tem A e D
outra LIB tem só A
Se você usar C e D, vai precisar de duas, e vai acusar A duplicado.
Se você usar só A, qualquer uma serve, só não dá pra saber se era o A que queria, a não ser quando der erro.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
alaminojunior
Colaborador
Colaborador
Mensagens: 1717
Registrado em: 16 Dez 2005 21:26
Localização: Ubatuba - SP

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por alaminojunior »

Eu também precisei codificar PDF para uso com API, e com as funções tradicionais do xHarbour não deu certo, e também não consegui descobrir o motivo.
Para algumas tarefas funcionam as funções do xHarbour, mas para codificar o PDF, não.
Precisei criar um executável em outra ferramenta para fazer a codificação e utilizar a API.
Compilador xHarbour 1.2.3 + Embarcadero C++ 7.30
MySQL c/ SQLRDD
HwGui + GTWVG
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por Itamar M. Lins Jr. »

Olá!
maravilha... muito bom ... valeu mesmo.. vou ver isso..
Siga firme que dará tudo certo.
Tem editores que trocam nomes de funções dentro de todos PRGs... É só usar esses recursos. xHarbour e Harbour a diferença principal é só o MT, que não foi finalizado(basicamente). O resto são os mesmos códigos. Eu acompanho isso desde o nascimento deles.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

PROBLEMAS AO CONVERTER HB_BASE64 UTF8 UTF-8

Mensagem por Itamar M. Lins Jr. »

Olá!
Os desenvolvedores do xHarbour (Ron Pinkas, Andi Jaja... e CIA) usam APENAS WINDOWS.
Já do Harbour usam Linux, como plataforma nativa. Isso é muito interessante. Só olhar que no xHarbour não tem polimento, funções com nomes diferentes que fazem a mesma coisa no mesmo OS.
A galera do dev do xHarbour não sabe "mexer" no Linux. Se sabem não tem interesse.

#xtranslate hb_ScrMaxRow() => gtInfo( HB_GTI_SCREENHEIGHT )
#xtranslate hb_ScrMaxCol() => gtInfo( HB_GTI_SCREENWIDTH )
#xtranslate MaxRow( .T. ) => gtInfo( HB_GTI_SCREENHEIGHT )
#xtranslate MaxCol( .T. ) => gtInfo( HB_GTI_SCREENWIDTH )

O xHarbour os script são basicamente em .BAT, o que tem para outros OS é lá da cópia do Harbour.
Não detecta não instala corretamente, essas novas distribuições Linux, quase ZERO pessoas usando no Linux. Inclusive houve uma serie de atualizações nesse sentido no Harbour esse ano.
O xHarbour não nasceu do ZERO, pegaram o Harbour(copia) e começaram a mudar, tudo ia muito bem, depois começaram a brigar...empresa pelo meio, etc...

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Responder