Wow. I've not coded in pearl in years since I started using PHP.
if it's org bot items you want, there is a much simpler way.
this website also hosts a public interface for org bots that behaves exactly like vhabot's central items database. in fact, Vhab has updated his bot plugin to use this website as the default items database.
to use it, you need to make an HTTP transaction from within pearl.
$cidb_server = "http://cidb.xyphos.com";
$url = $cidb_server;
$url .= '?bot=
<BotNameGoesHere>';
$url .= '&search=' . urlencode(
<Item You're Looking For>);
$url .="&output=
<Format>";
//valid formats are: aoml, xml, text if($ql) { $url .= '&ql=' . $ql; }
// add a QL specification if supplied$content = HTTP::Get($url);
$content will depend on what you provided as the
output parameter. if it was
aoml, you'll get back an "AO HTML" script that you can put directly into AO chat.
if it was
xml, you'll get an XML document (UTF-8) that you could parse in your own way.
text will give you a plain-text version separated by
;'s if you want to customize the output
item searches can be done the same manner as a google search.
example: !items sword kyr -energy
will give you all of the items named like "sword kyr" (Kyr'Ozch Sword included) but filter out the results containing the word "Energy"
you can use as many words and/or filters as you wish.
as for this database here, it is created and updated by a custom tool XRDB3.
XRDB4 was released to the public while XRDB3 is a private tool that is too unstable and unfit for a public release.
XRDB3 reads directly from AO's database, stores information as a SQLite3 database, does some extra stuff at the end then dumps a .sql file to be uploaded and used from an SSH login.
if you use the CIDB mentioned above, it'll save you the trouble of having to constantly update your bot's database

As for the encoding problem, I've added UTF-8 to the plugin.
download version 4.6.1 from the first page in this thread.
also, if you're interested, this website hosts another public interface
http://inits.xyphos.com which will show you a dozen init calculations for any given weapon.
url parameters are
lowid,
highid,
ql and
output (output being the same as cidb)
you can get the lowid/highid/ql information just by dropping the item into chat.