Welcome to the Axosoft Community, Sign in | Register | Help
in Search

ASCII(13) is converted to ASCII(10) ... still??

Last post 03-15-2007, 12:58 PM by mdp2176. 2 replies.
Sort Posts: Previous Next
  •  03-14-2007, 1:29 PM 10668

    ASCII(13) is converted to ASCII(10) ... still??

    It appears that this bug still exists inthe 2007 SDK BETA.  Last comment from Axosoft on the thread below implied that the next version would have a fix for this.  Is there going to be a fix for this at any point?  The thread below was locked, but this is definitely not resolved.

    I found this was not resolved because the 2007 upgrade appears to have dropped the trigger I created to band aid the issue.  Once I put the trigger back in, the carriage returns were once again carried through.

    http://forums.axosoft.com/shwmessage.aspx?ForumID=13&MessageID=7781

    Filed under: , ,
  •  03-15-2007, 12:51 PM 10669 in reply to 10668

    RE: ASCII(13) is converted to ASCII(10) ... still??
    The SDK, Remote Server, and much of OnTime web are implemented as web services, which work by serializing all transmitted data into XML documents. The XML 1.0 and 1.1 specs mandate that all line-endings be normalized to line feeds during document creation, so as a result, any string data transmitted through a web service will have all carrige returns stripped out.

    Because this behavior is so integral to the way web services work, finding a practical workaround to this issue hasn't been trivial.

    Long-term, we are still researching a solution to implement product-wide. But short-term, the most practical workaround appears to be to manually renormalize the line endings back to CR+LF where necessary for display purposes (i.e. when putting the text into a plain textbox).

    Adam Merz
    Axosoft
    Development Team
    Axosoft
    Filed under: , ,
  •  03-15-2007, 12:58 PM 10670 in reply to 10668

    RE: ASCII(13) is converted to ASCII(10) ... still??

    Adam, thank you for the explanation.  The issue is understandable (we deal with the same through our own web service API).  Wasn't sure if you noticed or not, but I did post a trigger in the thread referenced above that resolves the issue:

     

    set ANSI_NULLS ON

    set QUOTED_IDENTIFIER ON

    go

     

    ALTER TRIGGER [DefectInsert]

    ON [dbo].[Defects]

    FOR INSERT

    AS

    BEGIN

    SET NOCOUNT ON;

    DECLARE @newdefectid int

    select @newdefectid = DefectID FROM inserted

    UPDATE Defects SET

    ReplicationProcedures = REPLACE(SUBSTRING(ReplicationProcedures, 1, DATALENGTH(ReplicationProcedures)), CHAR(10), CHAR(13) + CHAR(10)),

    Description = REPLACE(SUBSTRING(Description, 1, DATALENGTH(Description)), CHAR(10), CHAR(13) + CHAR(10)),

    Notes = REPLACE(SUBSTRING(Notes, 1, DATALENGTH(Notes)), CHAR(10), CHAR(13) + CHAR(10))

    WHERE DefectID = @newdefectid

    END

    Filed under: , ,
View as RSS news feed in XML

© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software