locked
VCCodeClass DeclarationText throws exception when Copyright 0xa9 character is in comment of class RRS feed

  • Question

  • If you source code classes include a comment which contains the copyright character 0xA9, such as:

    ////////////////////////////////////////////////////////////////////////////////////////////////////
    //  COPYRIGHT © 2012 by company xyz
    ////////////////////////////////////////////////////////////////////////////////////////////////////

    and you call DeclarationText method on the VcCodeClass object for the class, it throws and an out-of-range exception "Value does not fall within the expected range".

    If you call StartPointOf[vsCMPart.vcCMPartName] it throws:

    A first chance exception of type 'System.Text.DecoderFallbackException' occurred in mscorlib.dll Additional information: Unable to translate bytes [A9] at index 116 from specified code page to Unicode.

    Is there a way to set the source code Encoder in the DTE/CodeModel  to allow the special characters to be tolerated without exceptions ?


    none

    • Moved by Youen Zen Monday, November 12, 2012 2:22 AM Appropriate forum for this issue (From:Visual Basic IDE)
    Friday, November 9, 2012 10:36 PM

All replies

  • Hi LanDen,

    We have a forum Visual Studio Extensibility for this issue. In order to provide better support, I will move this thread.

    Best regards,


    Shanks Zen
    MSDN Community Support | Feedback to us

    Monday, November 12, 2012 2:21 AM
  • Hi LanDen,

    '©' causes this issue. The value of '©' is A9 in ASCII table. Howeve it is can't translate these bytes.

    If we remove '©', the issue will be remove.

    >Is there a way to set the source code Encoder in the DTE/CodeModel to allow the special characters to be tolerated without exceptions ?

    I can't find a way to set the code Encoder.

    Best regards, 


    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 12, 2012 9:18 AM