uint8_t CountryCode::getLanguageFromDMOZ(long catid) {
	if(!m_init) return(0);
	catcountryrec_t ccr;
	ccr.lval = 0L;
	if(s_catToCountry.getNumSlotsUsed() < 1) return(0);
	long slot = s_catToCountry.getSlot((long)catid);
	if(slot < 0) return(0);
	ccr.lval = s_catToCountry.getValueFromSlot(slot);
	return(ccr.sval.lang);
}
void CountryCode::debugDumpNumbers(void) {
	long slot;
	catcountryrec_t ccr;
	for(slot = 0; slot < s_catToCountry.getNumSlotsUsed(); slot++) {
		ccr.lval = 0L;
		ccr.lval = s_catToCountry.getValueFromSlot(slot);
		if(ccr.lval)
			log( "Slot %ld has lang %d, country %d (%ld)\n",
					slot, ccr.sval.lang, ccr.sval.country, ccr.lval);
	}
}
void gbiconv_reset(){
	for (long i=0;i<s_convTable.getNumSlots();i++){
		long key = s_convTable.getKey(i);
		if (!key) continue;
		iconv_t conv = (iconv_t)s_convTable.getValueFromSlot(i);
		if (!conv) continue;
		//logf(LOG_DEBUG, "iconv: freeing iconv: 0x%x", (int)iconv);
		g_mem.rmMem((void*)conv, 52, "iconv");
		libiconv_close(conv);
	}
	s_convTable.reset();
}