Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem creating files with iso-8859-2 encoding

problem creating files with iso-8859-2 encoding

Scheduled Pinned Locked Moved C#
helpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cellardoor0716
    wrote on last edited by
    #1

    I´m trying to create .txt files with iso-8859-2 encoding, but I have problems with some of the characters from the charset. They don´t display correctly in the file. Here is my code sample that I use to create the files: File.WriteAllText(filePath, fileContent, Encoding.GetEncoding("iso-8859-2")); Can anyone help me with this?

    cellardoor

    G 1 Reply Last reply
    0
    • C cellardoor0716

      I´m trying to create .txt files with iso-8859-2 encoding, but I have problems with some of the characters from the charset. They don´t display correctly in the file. Here is my code sample that I use to create the files: File.WriteAllText(filePath, fileContent, Encoding.GetEncoding("iso-8859-2")); Can anyone help me with this?

      cellardoor

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      That looks perfectly fine. What are you using to display the file? Does the encoding actually support the characters that you write to it?

      Despite everything, the person most likely to be fooling you next is yourself.

      C 1 Reply Last reply
      0
      • G Guffa

        That looks perfectly fine. What are you using to display the file? Does the encoding actually support the characters that you write to it?

        Despite everything, the person most likely to be fooling you next is yourself.

        C Offline
        C Offline
        cellardoor0716
        wrote on last edited by
        #3

        I use Notepad. Yes according to http://en.wikipedia.org/wiki/ISO_8859-2[^] the encoding supports the characters I´m trying to write.

        cellardoor

        G 1 Reply Last reply
        0
        • C cellardoor0716

          I use Notepad. Yes according to http://en.wikipedia.org/wiki/ISO_8859-2[^] the encoding supports the characters I´m trying to write.

          cellardoor

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          cellardoor0716 wrote:

          I use Notepad.

          That would probably explain it. Notepad only uses that encoding if it's the default encoding for your system.

          Despite everything, the person most likely to be fooling you next is yourself.

          C 1 Reply Last reply
          0
          • G Guffa

            cellardoor0716 wrote:

            I use Notepad.

            That would probably explain it. Notepad only uses that encoding if it's the default encoding for your system.

            Despite everything, the person most likely to be fooling you next is yourself.

            C Offline
            C Offline
            cellardoor0716
            wrote on last edited by
            #5

            Yes, that was the problem, thanks for your help.

            cellardoor

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups