Trouble Getting UFT to Work with Simplified Chinese.
Hi all. I'm hoping somebody out there can be of some help to me.
I'm trying to enhance my existing scripts, which were written and work in English, to work with Simplified Chinese. The scripts are used to create a basic case and the only pieces that need to be translated is the drop down values. The lists do not have all of the same values and sort order for each language. So, for example, the English list could have A, B, C, and D and the Chinese list could have B, C, F, and G. We have been able to successfully adapt and run these scripts in Spanish, French, German, and Italian.
The method we have used for the other languages is to store all of the values in a local CSV file and do a lookup in the file of the English word when a translation is needed. Below is the code on how we declare in the CSV file and a snip of a row in the CSV file.
My problem is when the Chinese values are read into UFT (v12.02) from the CSV file, they do not match; therefore, no value is selected. In the CSV file snippet, you can see the characters for China are displayed as "中国" but "涓浗" is what I see in UFT.
Anybody have any thoughts?
Code Sample (CSV File Object):
' Define connection and recordset and read table
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "D:\UPSData\QTP\Input Data\"
strFileName = "ECM_LOV_TranslationDecode.csv"
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
CSV File (Sample of rows):
You basically have 3 gates which things get encoded will be encoding nightmare at each one.
the CSV file, then from the file stream to the ODBC driver, than from the ODBC driver to ADODB connector.
I don't really have a good way of doing it using CSV (or in general in VBScript). I'd probably either recommend using a base64 encoder and encode it in base64 in the CSV file, then decode it in your automated test. The downside is, the CSV file will look like complete gibberish, but that will by pass the encoding problems.