Intellipro      Your Ad Here

Automating QTP Test Automation                  Home Automation Articles Downloads QTP Gotchas Links Books Contact About Site Map

Home

Automation

Articles

Downloads

QTP Gotchas

Links

Books

Contact

About

Site Map

 

 

 

 

 

Gotchas - Unicode vs. Ascii

Unicode

When I get stuck trying to extract data from a web page, my final resort is to get the raw HTML and parse that (see Get Html)

     Sometimes, to aid debugging, I would save the HTML to a file so I could go back and check it manually.

     Sometimes the file write failed for no apparent reason.

It turns out that most (not all) websites are UTF-8 but QTP handles things internally in Unicode.

     But the Scripting FileSystemObject OpenTextFile default format is Ansi/Ascii.

Most of the time, you get away with it, but now and again, it blows up on you.

So when you open a file to write Unicode to, you have to remember to:

     Set oFileTo = oFsoTo.OpenTextFile("", ForWriting, True, TristateTrue)

          (where Const ForWriting = 2, TristateTrue = -1)

I also have a function that gets the file encoding here

Your Ad Here

Copyright © 2009 Intellipro Services Ltd. All rights reserved                      Home About Privacy Policy Terms of use Contact Site Map






































































advanced advice agile answers application articles aut automated automating automation basics beginners browser button checkbox child childobjects click close code coding combo combobox consultant consultancy convention count createobject database delete descriptive download downloads dp edit editbox element enhancements error examples faq faqs file files filesystemobject fixes folder folders forum framework frameworks function functions generation generator getobject getroproperty gotchas group guide guru harness hewlett hp inputbox insert intellipro interview language library libraries link list listbox manifesto manual master name naming navigate object or packard page ping pro problem procedure procedures professional programming qtp query queries question questions quick quicktest radio refresh repository ross row rows samples script scripts scrum select server software specific sprint sql step stored strategy structure sub subroutine suite sync tables test testing text textbox title tool tools tsl tutorial update updates url vbscript web webedit webpage webradiogroup weblist whittaker wscript