| || |
how to read the special characters in .ini file like «
I am reading the data from .ini file and validating in web application. My ini file contains the data like
ProgramType = "Benefit Dentegra Premier«"
I am using the below function to get the data.
Public Function GetINIValue(fileName, sectionName, keyName)
val = String(255, " ")
sze = Extern.GetPrivateProfileStringA(sectionName, keyName, "", val, 255, fileName)
val = Left(val,sze)
When I try to read the data from the ini file the QTP is getting the value for ProgramType like "Benefit Dentegra Premier┬«", because of this my test case is failing even though correct value is showing in application. Please some one can help on these case.
Maybe you can use the ANSI Char equivalent in the check:
expectedText = "Benefit Dentegra Premier" & Chr(174)
If StrComp(ProgramType ,expectedText) = ) then
My best guess is maybe your text editor doesn't know it's encoded in ASCII. So you might want to find a code editor that lets you specify encoding options, and select ANSI or ASCII
Or when you open the file, use the format options to specify unicode, http://msdn.microsoft.com/en-us/libr...(v=vs.84).aspx
Last edited by dlai; 10-07-2014 at 08:46 AM.
Thanks a lot for your help. I am using Notepad++ as an editor and edited the file in ANSI format and now it is working good with out changing my existing function.