Hello
I have to print Chinese idioms via socket with ESC / POS , as examples
the message on the screen is correct ,but the printed result is wrong (other idioms )
.
I compared with sockserv.prg (from fwh \ samples folder)
the transmission and reception of the program in FW and a program that correctly prints and analyzes the strings character by character with asc ()
this is the result :
Correct
---------------
214
208
185
250
176
230
With FW error
--------------------
228
184
173
229
155
189
231
137
136
I think you have to use a conversion program. Can someone help me ?
Maurizio
I have to print Chinese idioms via socket with ESC / POS , as examples
#include "FiveWin.ch"
#include "hbsocket.ch"
#define ADDRESS Â Â Â Â Â Â Â Â Â Â "192.168.0.139"
#define PORT Â Â Â Â Â Â Â Â Â Â Â Â 9100
#define EOT Â Â Â Â Â Â Â Â Â Â Â Â ( Chr( 4 ) )
//----------------------------------------------------------------------------//
function Main()
 local hSocket ,c1 := ''
Â
  FW_SetUnicode( .T. )
  c1 := '"ä¸å›½ç‰ˆ"'
 Â
  if empty( hSocket := hb_socketOpen() )
    ? "socket create error " + hb_ntos( hb_socketGetError() )
  endif
  if !hb_socketConnect( hSocket, { HB_SOCKET_AF_INET, hb_socketResolveAddr( ADDRESS ), PORT } )
    ? "socket connect error " + hb_ntos( hb_socketGetError() )
  endif
 Â
  MsgInfo(c1)
  hb_socketSend( hSocket,c1  +  chr(10)+chr(13)) Â
Â
  hb_socketShutdown( hSocket )
  hb_socketClose( hSocket )
Â
return nilthe message on the screen is correct ,but the printed result is wrong (other idioms )
I compared with sockserv.prg (from fwh \ samples folder)
the transmission and reception of the program in FW and a program that correctly prints and analyzes the strings character by character with asc ()
this is the result :
Correct
---------------
214
208
185
250
176
230
With FW error
--------------------
228
184
173
229
155
189
231
137
136
I think you have to use a conversion program. Can someone help me ?
Maurizio
Maurizio
www.nipeservice.com
www.nipeservice.com