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 »

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: 992
Joined: Tue Apr 25, 2006 9:45 am

Re: Component takes LF as CRLF

Post by alt »

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 »

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: 992
Joined: Tue Apr 25, 2006 9:45 am

Re: Component takes LF as CRLF

Post by alt »

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

Re: Component takes LF as CRLF

Post by alt »

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 »

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