Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
pcfriend2010 #1
Member since Feb 2012 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Problems when sending Korean characters using BOSH
I testing AGS BOSH with openfire 3.7.1 bosh connection.
i send "aaabbb" is ok but i if i send korean 2 byte char,
connection is die ( disconnected).

am i convert characters ?


     
  1.  ' connection code
  2.         objXmpp = New agsXMPP.XmppClientConnection
  3.  
  4.         Dim jid As agsXMPP.Jid
  5.         jid = New agsXMPP.Jid(txtUserName.Text.Trim + "@mobile")
  6.         objXmpp.Password = txtPassword.Text
  7.         objXmpp.Username = jid.User
  8.         objXmpp.Server = jid.Server
  9.         objXmpp.Port = 80
  10.         objXmpp.SocketConnectionType = SocketConnectionType.Bosh
  11.         objXmpp.ConnectServer = "http://xxx.xxx.xxx.xxx/xmpp-httpbind/" ' your BOSH Url here only
  12.         objXmpp.KeepAlive = True
  13.         objXmpp.AutoResolveConnectServer = True
  14.  
  15.         'objXmpp.ServerLanguage = 
  16.         Try
  17.             AddHandler objXmpp.OnMessage, AddressOf messageReceived
  18.             AddHandler objXmpp.OnAuthError, AddressOf loginFailed
  19.             AddHandler objXmpp.OnLogin, AddressOf loggedIn
  20.             AddHandler objXmpp.OnError, AddressOf errorIn
  21.             AddHandler objXmpp.OnClose, AddressOf closeIn
  22.  
  23.             objXmpp.Open()
  24.         Catch ex As Exception
  25.             MsgBox(ex.Message)
  26.         End Try
  27.  
  28.  
  29.     'messageReceived
  30.     Private Sub messageReceived(ByVal sender As Object, ByVal msg As protocol.client.Message)
  31.  
  32.         Dim chatMessage() As String
  33.         chatMessage = msg.From.ToString.Split("/")
  34.  
  35.         Dim jid As agsXMPP.Jid
  36.         jid = New agsXMPP.Jid(chatMessage(0))
  37.         Dim autoReply As protocol.client.Message
  38.  
  39.     Dim mBd = msg.Body
  40.     autoReply = New protocol.client.Message(jid, protocol.client.MessageType.chat, mBd)
  41.     objXmpp.Send(autoReply)
  42.  
  43.     End Sub
This post was edited 2 times, last on 2012-02-28, 07:29 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by pcfriend2010:
I testing AGS BOSH with openfire 3.7.1 bosh connection.
i send "aaabbb" is ok but i if i send korean 2 byte char,
connection is die ( disconnected).

am i convert characters ?
You don't have to convert any characters. XMPP is using UTF-8 as encoding and is compatible with all unicode characters.
  • Are you sending this 2 byte characters from agsXMPP or another client?
  • Do you have Xml logs?
  • Have you tested other servers than Openfire?

Alex
Avatar
pcfriend2010 #3
Member since Feb 2012 · 7 posts
Group memberships: Members
Show profile · Link to this post
I have code refer  Subject: Problems when sending Latin characters using BOSH

agsXMPP source code edited by above..
and good works.

thanks.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
were you using the latest SVN version? Because this was reported and fixed a while ago.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS