ERROR -- : Error receiving data: incompatible character encodings: ASCII-8BIT and US-ASCII

242 views
Skip to first unread message

ben.l...@gmail.com

unread,
Jun 11, 2013, 7:24:31 AM6/11/13
to ruby...@googlegroups.com
Hi, I am following the example on the github page. But I keep getting the above error. If i set the encoding at the beginning of the file, it returns it right away, otherwise it sends it after I have successfully sent a message. I am using routesms.com as the SMSC. Here are the instructions that they have on the encoding:

Character Sets, Class and Data Coding:
The Routesms® Messaging Platform supports the following two types of data coding schemes:

  •   GSM 03.38 Encoding (default)

  Latin 1 (ISO-8859-1) encoding
The default character set is GSM 338. Although for data_coding=1 the character set GSM 03.38 is supported it is
NOT RECOMMENDED, as it is known to cause problems with character encoding. Please set data_coding = 3 for ISO-8859-1(if and only if told so explicitly) encoded messages and data_coding=0 for GSM 03.38 encoded messages.
For Unicode messages you have to set
data_coding = 8 and the message is expected in UTF-16 Big Endean format. 

Any help on this issue would be of help

Ray Krueger

unread,
Jun 11, 2013, 8:50:43 AM6/11/13
to ruby...@googlegroups.com
What version of ruby are you using?


--
You received this message because you are subscribed to the Google Groups "ruby-smpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-smpp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Craig Johnson

unread,
Oct 30, 2014, 10:42:21 PM10/30/14
to ruby...@googlegroups.com
Hi,

I am seeing this error as well and would really appreciate any help you can offer. SMS messages get sent but I receive this error when receiving the delivery report. I don't see the error when I use the logica simulator.

Ruby version:     ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
SMSC:               smsglobal.com

Error:
D, [2014-10-31T13:34:40.737249 #11553] DEBUG -- : DeliverSM with source_addr=614xxxxxxxx, destination_addr=614xxxxxxxx, msg_reference=6679927934488935, stat=DELIVRD
E, [2014-10-31T13:34:40.737629 #11553] ERROR -- : Exception while reading PDUs: incompatible character encodings: ASCII-8BIT and UTF-8 in /usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
E, [2014-10-31T13:34:40.737765 #11553] ERROR -- : Error receiving data: incompatible character encodings: ASCII-8BIT and UTF-8
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:50:in `initialize'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `new'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `from_wire_data'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:159:in `create'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:261:in `read_pdu'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:106:in `receive_data'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
./main.rb:186:in `block in start'
./main.rb:185:in `loop'
./main.rb:185:in `start'
./main.rb:419:in `<main>'

main.rb lines 185-193:

    loop do
      EventMachine::run do
        @@tx = EventMachine::connect(
          config[:host],
          config[:port],
          Smpp::Transceiver,
          config,
          self    # delegate that will receive callbacks on MOs and DRs and other events
        )

Cheers,

Craig

Craig Johnson

unread,
Oct 31, 2014, 8:29:34 PM10/31/14
to ruby...@googlegroups.com
Update:

No change after upgrading to Ruby 2.1.4:

D, [2014-11-01T10:42:59.465178 #3763] DEBUG -- : DeliverSM with source_addr=614xxxxxxx, destination_addr=614xxxxxxx, msg_reference=6513793089579404, stat=DELIVRD
E, [2014-11-01T10:42:59.465530 #3763] ERROR -- : Exception while reading PDUs: incompatible character encodings: ASCII-8BIT and UTF-8 in /usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
E, [2014-11-01T10:42:59.465639 #3763] ERROR -- : Error receiving data: incompatible character encodings: ASCII-8BIT and UTF-8
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:50:in `initialize'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `new'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `from_wire_data'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:159:in `create'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:261:in `read_pdu'
/usr/local/rvm/gems/ruby-2.1.4/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:106:in `receive_data'
/usr/local/rvm/gems/ruby-2.1.4/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/usr/local/rvm/gems/ruby-2.1.4/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
main.rb:187:in `block in start'
main.rb:186:in `loop'
main.rb:186:in `start'
main.rb:480:in `<main>

Ray Krueger

unread,
Nov 3, 2014, 5:58:53 PM11/3/14
to ruby...@googlegroups.com
Unfortunately I think you're going to run into that on Ruby 2.0 due to the encoding changes. There was some work being done to try and update the code but that went stale.

If you can come up with a fix for this I'll merge a pull request. Unfortunately I don't work on this project lately as I don't work with sms anymore.

For more options, visit https://groups.google.com/d/optout.

Craig Johnson

unread,
Nov 4, 2014, 1:01:56 AM11/4/14
to ruby...@googlegroups.com
Thanks Ray, I'll see what I can do.

If it rings any bells at all I am getting the same result with ruby 1.9.3-p448...


D, [2014-11-04T15:46:50.896832 #31118] DEBUG -- : DeliverSM with source_addr=614xxxxxxxx, destination_addr=614xxxxxxxx, msg_reference=6094770654973403, stat=DELIVRD
E, [2014-11-04T15:46:50.897174 #31118] ERROR -- : Exception while reading PDUs: incompatible character encodings: ASCII-8BIT and US-ASCII in /usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
E, [2014-11-04T15:46:50.897306 #31118] ERROR -- : Error receiving data: incompatible character encodings: ASCII-8BIT and US-ASCII
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:91:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:50:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/deliver_sm.rb:135:in `from_wire_data'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/pdu/base.rb:159:in `create'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:261:in `read_pdu'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/ruby-smpp-0.6.0/lib/smpp/base.rb:106:in `receive_data'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
main.rb:189:in `block in start'
main.rb:188:in `loop'
main.rb:188:in `start'
main.rb:480:in `<main>'

Cheers,

Craig

Ray Krueger

unread,
Nov 4, 2014, 7:02:28 AM11/4/14
to ruby...@googlegroups.com
Try pulling Master. I merged a pull request last night. 

-Ray

Ray Krueger

unread,
Nov 7, 2014, 9:34:53 AM11/7/14
to ruby...@googlegroups.com
Craig,

I'm refreshing my memory on how this works. It's been a long while. When you start the EventMachine connection with the Smpp::Transceiver, what does your config object looks like?

Reply all
Reply to author
Forward
0 new messages