#16 EscapeNonAscii and UnescapeNonAscii optimization and bug fix

open
nobody
None
5
2011-04-06
2011-04-06
Francois Dumont
No

I plan to propose this patch as an optimization of the IorUtil.EscapeNonAscii and IorUtil.UnescapeNonAscii that was creating a lot of intermediate strings. But doing so I discovered a bug. UnescapeNonAscii is using the IsPotentiallyEscapedCharacterRepresentation method that looks for an escaoe sequence "\uXXXX". To do so this method was using Char.IsDigit to check that XXXX was correct chars but IsDigit only returns true for decimal numbers and XXXX is an hexadecimal representation with 'A' to 'F' chars.
I have added some tests to check new implementation behavior.
There is also a major optimization of the StringConversions.Destringify method.

Discussion

  •  
    Attachments
  • Hi!
    This patch was integrated in rev. 2012, but I found out that it breaks IntegrationTests/Direct. Error message is:
    Test Error : Ch.Elca.Iiop.IntegrationTests.TestClient.TestIdsIncludingNonAscii
    Ch.Elca.Iiop.GenericUserException : Exception of type 'Ch.Elca.Iiop.GenericUserException' was thrown.
    Could you, please, investigate the issue and fix it?
    Thank you for your efforts.
    Bye!

     
  • Jens Villadsen
    Jens Villadsen
    2011-09-24

    dums, please investigate issue identified by alexfh