Forum Discussion

rajabe9209's avatar
rajabe9209
Occasional Contributor
7 years ago

Chinese Letter displaying as ??

Am testing Web page which is in chinese Language test data is in Excel Cell am pulling the testdate in variable and trying to using it in java script  now when is pick the Excel data which is a chinese letter it shows in ?? in the variable

how to display the letter as it is in excel below are the code i used 

 

var Temp=VarToString(excelMainSheet_TestCase.Cells.Item(i,9));
Log.Message(Temp)

 

Temp it shows as ?? mark

 

 

 

  • shankar_r's avatar
    shankar_r
    Community Hero

    I googled and come with some sort of idea,

     

    I hope you are doing ADODB to get data, you can try the following.

     

    Edward
    
    Very many thanks for taking the time and solving this problem.
    
    I did not fully understand your description however my connection string
    
    sconnect = "Provider=MSDASQL.1;DSN=Excel Files;DBQ=" & SpreadSheetName & ";HDR=Yes';"
    
    read chinese characters as ????, whereas your connection string:
    
    sconnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & SpreadSheetName & "';" & "Extended Properties=""Excel 12.0;HDR=YES;IMEX=1;"";"
     read them as 北京, 中国 (even in the VBA code)
    Thats a great result, thanks again.

     

    • rajabe9209's avatar
      rajabe9209
      Occasional Contributor

      Ho it was simple solution i when fectching the data i converted it to VarToString

      but when i removed it is working

       

      var Temp=VarToString(excelMainSheet_TestCase.Cells.Item(i,9));
      Log.Message(Temp)

       

      Working fine

      var Temp=(excelMainSheet_TestCase.Cells.Item(i,9));
      Log.Message(Temp)