Component takes LF as CRLF

.NET library for SMPP protocol
Locked
olumosco
Posts: 4
Joined: Thu Jul 23, 2015 12:37 pm

Component takes LF as CRLF

Post by olumosco » Fri Feb 16, 2018 7:55 am

I noticed the component counts LF appended to each line of my message as 2 characters (i.e CRLF) even though I specifically appended LF instead of CRLF.
Example of such message is given below which is 160 characters (if the 14 LF characters after "9" is interpreted correctly as LF). But the component sends it as multi-part.

0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
012345
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Component takes LF as CRLF

Post by alt » Mon Feb 19, 2018 10:12 pm

Hi olumosco,

Which data coding and mapped encoding did you use?

https://docs.inetlab.com/smpp/articles/ ... oding.html
olumosco
Posts: 4
Joined: Thu Jul 23, 2015 12:37 pm

Re: Component takes LF as CRLF

Post by olumosco » Wed Feb 21, 2018 3:22 am

Hi alt,

I used "Default SMSC Encoding" for data coding.
I did not specify anything for mapped encoding.

alt wrote:
Mon Feb 19, 2018 10:12 pm
Hi olumosco,

Which data coding and mapped encoding did you use?

https://docs.inetlab.com/smpp/articles/ ... oding.html
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Component takes LF as CRLF

Post by alt » Sun Mar 11, 2018 3:11 pm

Thank you olumosco.
I have reproduces this issue. I'll try to fix it in the next release.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Component takes LF as CRLF

Post by alt » Fri May 04, 2018 10:42 pm

Hi olumosco,

My test was wrong. So I cannot reproduce your case.

Following test code works correct:

Code: Select all

         char LF = Convert.ToChar(10);

            string text = "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF +
                          "0123456789" + LF + 
                          "012345";
            

            Assert.AreEqual(160, text.Length);

            EncodingMapper mapper = new EncodingMapper();
          
            IList<SubmitSm> list = SMS.ForSubmit()
                .Text(text)
                .From("1111")
                .To("2222")
                .Create(mapper);

            Assert.AreEqual(1, list.Count);
olumosco
Posts: 4
Joined: Thu Jul 23, 2015 12:37 pm

Re: Component takes LF as CRLF

Post by olumosco » Thu Jul 12, 2018 9:31 pm

I can confirm your analysis is correct. The component works correctly.
Thank you.
Locked