# Loadstrings with Umlauts Umlaut Umlaute / CSV from Excel

**URL:** <https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132>\
**Category:** Beginners\
**Created:** [December 5, 2019, 12:39am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132 "2019-12-05T00:39:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 5, 2019, 12:39am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/1 "2019-12-05T00:39:32Z")

</div>

Hello all,

I am loading / loadstrings a CSV with swedish Umlauts

öå

They don’t come out right - What can I do?

```auto

 // -------------------------------------------------------------------------------------------
  // load articles section 

  void loadArticles() {
    //
    String name1 = "Example articles 1.csv";
    String[] loadData = loadStrings(name1);

    valuesArray1 = new JSONArray();

    int i=0; 
    for (String s1 : loadData) {

      if (s1.equals("Art nr;Description;Type"))
        continue;

      String[] s2 = split(s1, ";"); 

      JSONObject article = new JSONObject();

      article.setString("id", s2[0]);
      article.setString("article", s2[1]);
      article.setString("articleType", s2[2]);

      valuesArray1.setJSONObject(i, article);
      i++;
    }//for
  }//func

  // -------------------------------------------------------------------------------------------

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 5, 2019, 12:59am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/2 "2019-12-05T00:59:05Z")

</div>

I am on a Win 10 machine

The data is from xlsx and I export from Excel as csv

The csv comes out correct when I look at it in notepad

I also tried loadTable instead of loadStrings

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 5, 2019, 2:57am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/3 "2019-12-05T02:57:48Z")

</div>

Have you checked whether “Example articles 1.csv” is indeed saved as UTF-8 encoding? 🤔

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 5, 2019, 3:30am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/4 "2019-12-05T03:30:06Z")

</div>

on a Win 10 / 64b / region US /

```auto
String swedish = "1,2,3,4,5,a,A,Å,å,Ä,ä,o,O,Ö,ö";
String[] lines;
String outfile = "data/test.csv"; 

void setup() {
  size(100,200);
  makeFile();
  loadFile();
}
void draw() {
}

void makeFile() {
  lines = swedish.split(",");
  saveStrings(outfile, lines);
  println("save to "+outfile);
}

Table data;

void loadFile() {
  int dy =0;
  data = loadTable(outfile,"csv");
  println(data.getRowCount() + " rows, "+data.getColumnCount() + " cols in table");
  for (TableRow row : data.rows()) text( row.getString(0) ,10,10+13*dy++);
}

/* data/test.csv
1
2
3
4
5
a
A
Å
å
Ä
ä
o
O
Ö
ö
*/

```

 ![NPP_setEncoding](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/180c716534f68ad0f90318de09010cfe3bb519d2.png)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 5, 2019, 8:40am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/5 "2019-12-05T08:40:04Z")

</div>

@GoToLoop

I tried to tell Excel to export in the right format but I don’t know how to tell it to

How can I?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 5, 2019, 8:54am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/6 "2019-12-05T08:54:31Z")

</div>

@kll

I know

But I come from excel

Question is what export format do I have to use in excel. I tried a lot of them though (txt, csv, tsv…)

Maybe export as webpage?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 5, 2019, 10:22am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/7 "2019-12-05T10:22:45Z")

</div>

test with LIBRE Office  
needed language swedish / UTF16  
but [SAVE AS] to CSV UTF 8 possible / worked

 ![RPI_LibreOffice_saveAs_CSV_options](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/39e4049b979460fd0af2495a85689824e4f8564a.png)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 5, 2019, 10:28am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/8 "2019-12-05T10:28:13Z")

</div>

> [@Code 800A0404 issue](https://discourse.processing.org/t/code-800a0404-issue/2036/3):
>
> Easiest & fastest recipe to run “.js” sketches under p5.js: running_man Install any Firefox-based browser in your OS and use it to open your “index.html” file: fox_faceInstall Notepad2 or Notepad++ (or both) in your OS and use it to type in your “sketch.js” file there: scroll[https://XhmikosR.GitHub.io/notepad2-mod/](https://XhmikosR.GitHub.io/notepad2-mod/)[https://Notepad-Plus-Plus.org](https://Notepad-Plus-Plus.org) You can setup those text editors to use UTF-8 and LF line endings for better compatibility. bulbHere’s my minimum “index.html” te…

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 5, 2019, 10:56am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/9 "2019-12-05T10:56:06Z")

</div>

I think I could copy the content in the Sketch and just parse into a Table() right?

Using split ()

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [December 7, 2019, 1:15am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/10 "2019-12-07T01:15:01Z")

</div>

Will saving your file as a UTF-8 CSV solve your problem, or do you need to make your code able to load non-UTF-8 text?

[https://processing.org/reference/loadStrings\_.html](https://processing.org/reference/loadStrings_.html)

Here is an old example of loading iso-8859-2 text:

[https://processing.org/discourse/beta/num\_1248357556.html](https://processing.org/discourse/beta/num_1248357556.html)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 7, 2019, 10:14am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132/11 "2019-12-07T10:14:32Z")

</div>

I just hard copied the content into the code of the sketch
