lailton.webmaster wrote:Try
- Code: Select all Expand view
HB_OemToAnsi( UTF8ToStr( cString ) )
Check it:
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=10986&hilit=utf8
Thanks Lailton but doesn't work. I think in give up.
lailton.webmaster wrote:Try
- Code: Select all Expand view
HB_OemToAnsi( UTF8ToStr( cString ) )
Check it:
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=10986&hilit=utf8
#include "Fivewin.ch"
Function Main()
cXML := StrTran( MemoRead( "retorno.xml" ), CRLF )
xMotivo := GetStringFromXMl('<xMotivo>','</xMotivo>', cXML )
MsgInfo(xMotivo)
Return Nil
Function GetStringFromXMl( cInicio, cFinal, cString )
Local nInicio:=At( cInicio, cString ) + Len( cInicio )
Local nFinal :=At( cFinal, cString ) - nInicio
Return Alltrim( Substr( cString, nInicio, nFinal ) )
<retCancCTe xmlns="http://www.portalfiscal.inf.br/cte" versao="1.03">
<infCanc Id="CTe52110104395298000137570010000000841589634677">
<tpAmb>2</tpAmb>
<cUF>52</cUF>
<verAplic>RS20100226092505</verAplic>
<cStat>218</cStat>
<xMotivo>Rejeição: CT-e ja esta cancelada na base de dados da SEFAZ</xMotivo>
<chCTe>52110104395298000137570010000000841589634677</chCTe>
<dhRecbto>2011-01-12T09:59:15</dhRecbto>
<nProt />
</infCanc>
</retCancCTe>
cXml := ""
Do while Empty( cXml )
cXML := TrataRetornoXml(StrTran( MemoRead( Arq_Erro ), CRLF ))
SysRefresh()
EndDo
xMotivo := GetStringFromXMl('<xMotivo>','</xMotivo>', cXML )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 102 guests