C # .NET Framework 1.1: I am trying to replace the French quotation mark with a normal quotation mark. He works on most of our development environment (machine), but when moving to a test environment, the system receives an error string cannot be of zero length .
Here is my code:
//replace French Quote with normal single Quote fileColumnName = "date d'embauche"; fileColumnName = fileColumnName.Replace("'","'");
Is this a problem with character encoding in a test environment?
Update: forgot to mention: this is a component of COM +; Do we have character encoding settings in COM +?
Sorry to be not very clear; here is most of the code: this can be confusing, so to be clear:
fileData is a data table (System.Data.Table) that is populated by connecting OLEDB to a CSV file. Then I get the column names that are compared with the names stored in the database (headerData).
//#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) < 0) { //check French if(fileColumnName.IndexOf(columnNameFrench) < 0) { //invalid row errs.Add("81181"); break; } } }
source share