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. Encoding problem??

Encoding problem??

Scheduled Pinned Locked Moved C#
helpquestion
4 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.
  • A Offline
    A Offline
    andredani
    wrote on last edited by
    #1

    Hi guys! having a bit of a problem.. im picking upp value from file rowes, and i live in sweden so we use the characters å,ä,ö a lot. so i want to replace the å ä ö with something else, because when i return the row in a listview the ö are like ? or something like that... =( i have tryade to save in diffirent encoding.. nothing works! anyone with the same problem as me?? i pick upp info from rowes like this: String row5 = File.ReadAllLines(file)[row]; string[] tecken = row5.Split(';'); string person = tecken[21]; anyone with good suggestions?? thanks!! peace! :doh:

    D 1 Reply Last reply
    0
    • A andredani

      Hi guys! having a bit of a problem.. im picking upp value from file rowes, and i live in sweden so we use the characters å,ä,ö a lot. so i want to replace the å ä ö with something else, because when i return the row in a listview the ö are like ? or something like that... =( i have tryade to save in diffirent encoding.. nothing works! anyone with the same problem as me?? i pick upp info from rowes like this: String row5 = File.ReadAllLines(file)[row]; string[] tecken = row5.Split(';'); string person = tecken[21]; anyone with good suggestions?? thanks!! peace! :doh:

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      UTF-8 should support Swedish characters. Are they not storing in your file correctly, or is it the listView not displaying them correctly?

      A 1 Reply Last reply
      0
      • D DaveyM69

        UTF-8 should support Swedish characters. Are they not storing in your file correctly, or is it the listView not displaying them correctly?

        A Offline
        A Offline
        andredani
        wrote on last edited by
        #3

        i think its the listview hwo doesn´t display them correclty. beacouse i have tryade every encoding.. are i changing the ecoding throught advanced save options???? Thanks

        D 1 Reply Last reply
        0
        • A andredani

          i think its the listview hwo doesn´t display them correclty. beacouse i have tryade every encoding.. are i changing the ecoding throught advanced save options???? Thanks

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          I've tested the listView and it displays them fine. Are you specifying the encoding to use when reading your file as I think that's where your problem is?

          System.Text.Encoding swedishEncoding;
          swedishEncoding = System.Text.Encoding.UTF8;
          //Or if that doesn't work;
          swedishEncoding = System.Text.Encoding.GetEncoding(437);

          //To read
          System.IO.StreamReader swedishReader = new System.IO.StreamReader("myPathHere", swedishEncoding, false);

          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