convert comment string to an ASCII character list in sicstus-prolog
<p>currently I am working on comparison between SICStus3 and SICStus4 but I got one issue that is SICStus4 will not consult any cases where the comment string has carriage controls or tab characters etc as given below.</p>

<p>Example case as given below.It has 3 arguments with comma delimiter. </p>

<pre><code>case('pr_ua_sfochi',"
Response:
answer(amount(2370.09,usd),[[01AUG06SFO UA CHI Q9.30 1085.58FUA2SFS UA SFO Q9.30 1085.58FUA2SFS NUC2189.76END ROE1.0 XT USD 180.33 ZPSFOCHI 164.23US6.60ZP5.00AY XF4.50SFO4.5]],amount(2189.76,usd),amount(2189.76,usd),amount(180.33,usd),[[fua2sfs,fua2sfs]],amount(6.6,usd),amount(4.5,usd),amount(0.0,usd),amount(18.6,usd),lasttktdate([20061002]),lastdateafterres(200712282]),[[fic_ticketinfo(fare(fua2sfs),fic([]),nvb([]),nva([]),tktiss([]),penalty([]),tktendorsement([]),tourinfo([]),infomsgs([])),fic_ticketinfo(fare(fua2sfs),fic([]),nvb([]),nva([]),tktiss([]),penalty([]),tktendorsement([]),tourinfo([]),infomsgs([]))]],&lt;&gt;,&lt;&gt;,cat35(cat35info([])))
.
02/20/2006 17:05:10 Transaction 35 served by static.static.server1 (usclsefat002:7551) running E*Fare version $Name: build-2006-02-19-1900 $

",price(pnr(
        user('atl','1y',&lt;&gt;,&lt;&gt;,dept(&lt;&gt;,'0005300'),&lt;&gt;,&lt;&gt;,&lt;&gt;),
        [
                passenger(adt,1,[ptconly(n)])
        ],
        [

segment(1,sfo,chi,'ua','&lt;&gt;','100',20140901,0800,f,20140901,2100,'737',res(20140628,1316),hk,pf2(n,[],[],n),&lt;&gt;,flags(no,no,no,no,no,no,no,no,no)),

segment(2,chi,sfo,'ua','&lt;&gt;','101',20140906,1000,f,20140906,1400,'737',res(20140628,1316),hk,pf2(n,[],[],n),&lt;&gt;,flags(no,no,no,no,no,no,no,no,no))
        ]),[
                rebook(n),
                ticket(20140301,131659),
                dbaccess(20140301,131659),
                platingcarrier('ua'),
                tax_exempt([]),
                trapparm("trap:ffil"),
                city(y)
        ])).
</code></pre>

<p>The below predicate will remove comment section in above case.</p>

<pre><code>flatten-cases :-
        getmessage(M1),
        write_flattened_case(M1),
        flatten-cases.
flatten-cases.
write_flattened_case(M1):-
        M1 = case(Case,_Comment,Entry),!,
        M2 = case(Case,Entry),
        writeq(M2),write('.'),nl.
getmessage(M) :-
        read(M),
        !,
        M \== end_of_file.
:- flatten-cases.
</code></pre>

<p>Now my requirement is to convert the comment string to an ASCII character list.</p>