Reading the File contents along with Wild characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amollokhande1
    New Member
    • Feb 2008
    • 33

    Reading the File contents along with Wild characters

    Hi,

    I am trying to read the file contents using
    Code:
    System.IO.File.ReadAllText
    After reading the file contents the special charaters (á) gets replaced with some garbage characters like "?".
    To elliminate this I have used encoding along with above method
    Code:
    System.IO.File.ReadAllText(strFile, System.Text.Encoding.ASCII)
    But still it is not working.Can anybody have the solution for this



    Regards
    Amol Lokhande
  • sagark
    New Member
    • Jan 2009
    • 12

    #2
    RE: Reading the File contents along with Wild characters

    Hi Amol,

    We need to read the file as per encoding type of the source file. If encoding type is unknown then we can use 'System.Text.Enc oding.Default'

    for example.

    System.IO.File. ReadAllText(Fil ePath, System.Text.Enc oding.Default)



    Regards,
    Sagar

    Comment

    • amollokhande1
      New Member
      • Feb 2008
      • 33

      #3
      Thanks Sagar. This really helped

      Comment

      Working...