title: Getting error "String cannot be of zero length" when replacing a French quote character with normal single quote
body: <p>C# .NET Framework 1.1: I am trying to replace a French quote character with a normal single quote. It is working on most of our development environment (machines) but when moved to the system test environment, getting a <code>string cannot be of zero length</code> error.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>//replace French Quote with normal single Quote
  fileColumnName = "date d’embauche";
  fileColumnName = fileColumnName.Replace("’","'");
  </code></pre>
  
  <p>Is it some issue with character encoding at the testing environment?</p>
  
  <p>Update: Forgot to mention: It is a COM+ component; do we have character encoding settings in COM+?</p>
  
  <p>Sorry for not being very clear; here is a large portion of the code: It may be confusing, so to make it clear:</p>
  
  <p><code>fileData</code> is a data table (System.Data.Table) which is populated by an OLEDB connection to the CSV file. Then I get column names which are compared against the names stored in the database (headerData).</p>
  
  <pre><code>//#5:  Invalid header row check
  foreach(DataRow hrow in headerData.Rows)
  {
  
          columnNameEnglish = hrow["EnglishDisplayValue"].ToString().ToLower();                //get english column definition
          columnNameFrench = hrow["FrenchDisplayValue"].ToString().ToLower();                        //get french column definition
          columnIndex = Convert.ToInt32(hrow["DataBaseValue"]);                                                //get corresponding index
          fileColumnName = fileData.Columns[columnIndex].ColumnName.ToLower();
  
          //replace french Quote with normal Quote
          fileColumnName = fileColumnName.Replace("’","'");
  
          //check English
          if(fileColumnName.IndexOf(columnNameEnglish) &lt; 0)
          {        
                  //check French
                  if(fileColumnName.IndexOf(columnNameFrench) &lt; 0)
                  {        
                          //invalid row 
                          errs.Add("81181");
                          break;
                  }
          }                                        
  }
  </code></pre>