title: Reading currency Symbol as string in Java
body: <p>I actually need to import a <strong>csv</strong> file for currency in my <em>pgAdmin</em> database. My file is as follows;</p>
  
  <p><a href="https://i.stack.imgur.com/sMsCe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sMsCe.jpg" alt="enter image description here"></a></p>
  
  <p>My code is as follows, using an ISO-8859-1 format.</p>
  
  <pre><code>        File fileDir = new File(fileName);       
          FileInputStream fis= new FileInputStream(fileDir);
          InputStreamReader isr= new InputStreamReader(fis, "ISO-8859-1");
          BufferedReader br = new BufferedReader(isr);            
          String line;
          line = br.readLine();
          String[] arrayHeader = line.split(";");         
          size = arrayHeader.length;       
  
          if(size==expectedSize){
               //check header 
              String header[] = {"Currency_ISO", "Currency_Label", "Currency_Symbol"};
              for(int i=0;i&lt;header.length;i++){
                  if(arrayHeader[i].trim().equals(header[i])){
                      fileStatus = true; 
                      sResult = "File Status: Valid &lt;br/&gt; "; 
                  }
                  else{
                      fileStatus = false;
                      sResult = "File Status: Invalid &lt;br/&gt; "; 
                      break;
                  }
              }
          }else{
              fileStatus = false;  
              sResult = "File Status: Invalid &lt;br/&gt; ";    
          }       
  
          if(fileStatus){     
  
               while ((line = br.readLine()) != null) {
                   String[] arrayData = line.split(";", -1);
  
                  //create object 
                  objCurrency = new clsCurrency(); 
  
                  if(arrayData[0] != "" &amp;&amp; !arrayData[0].isEmpty() &amp;&amp; arrayData[0].trim() != ""){
  
                      objCurrency.setsCurrencyIso(arrayData[0].trim());
                  }else{
                      objCurrency.setsCurrencyIso(null);
                  }
  
                  if(arrayData[1] != "" &amp;&amp; !arrayData[1].isEmpty() &amp;&amp; arrayData[1].trim() != ""){                                         
                      objCurrency.setsCurrencyLabel(arrayData[1].trim());
                  }else{
                      objCurrency.setsCurrencyLabel(null);
                  }
  
                  if(arrayData[2] != "" &amp;&amp; !arrayData[2].isEmpty() &amp;&amp; arrayData[2].trim() != ""){
                  System.out.println("setsLocalCurrencySymbol: " + arrayData[2]);
                      objCurrency.setsCurrencySymbol(arrayData[2].trim());
                  }else{
                      objCurrency.setsCurrencySymbol(null);
                  }
  
                  lstCurrencyImported.add(objCurrency);
  
              }//end while    
  </code></pre>
  
  <p>As you can see, I have a <code>System.out.Println()</code> to check the values being read for the symbols. But the main issue is that the Symbol is not being read correctly. It is returning a <code>?</code> instead. See the println below;</p>
  
  <pre><code>[stdout] (default task-7) setsCurrencySymbol: ?
  </code></pre>
  
  <p>I tried changing the format to <code>UTF-8</code> or <code>UTF-16</code>, but in vain.
  I saw online that there is the <strong>currency</strong> class for Java, but problem is that I need to read it from the csv directly, and I don't think the users know the code for each currency.</p>
  
  <p>Any idea how do I proceed from here guys?</p>