le-search: Fix character encoding conversion

parent 958c4800
File mode changed from 100644 to 100755
############################################################################# #############################################################################
# Makefile for building: qt # Makefile for building: le-search
# Generated by qmake (2.01a) (Qt 4.7.0) on: qui jan 27 10:12:45 2011 # Generated by qmake (2.01a) (Qt 4.6.2) on: seg set 10 14:06:51 2012
# Project: qt.pro # Project: qt.pro
# Template: app # Template: app
# Command: /usr/bin/qmake -o Makefile qt.pro # Command: /usr/bin/qmake -unix -o Makefile qt.pro
############################################################################# #############################################################################
####### Compiler, tools and options ####### Compiler, tools and options
...@@ -13,10 +13,10 @@ CXX = g++ ...@@ -13,10 +13,10 @@ CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/libxml2 -I. -I. -I. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/libxml2 -I. -I.
LINK = g++ LINK = g++
LFLAGS = -Wl,-O1 LFLAGS = -Wl,-O1
LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread -lxml2 LIBS = $(SUBLIBS) -L/usr/lib -lxml2 -lQtGui -lQtCore -lpthread
AR = ar cqs AR = ar cqs
RANLIB = RANLIB =
QMAKE = /usr/bin/qmake QMAKE = /usr/bin/qmake
...@@ -128,7 +128,7 @@ Makefile: qt.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mks ...@@ -128,7 +128,7 @@ Makefile: qt.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mks
/usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/libQtGui.prl \ /usr/lib/libQtGui.prl \
/usr/lib/libQtCore.prl /usr/lib/libQtCore.prl
$(QMAKE) -o Makefile qt.pro $(QMAKE) -unix -o Makefile qt.pro
/usr/share/qt4/mkspecs/common/g++.conf: /usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf: /usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf: /usr/share/qt4/mkspecs/common/linux.conf:
...@@ -151,11 +151,11 @@ Makefile: qt.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mks ...@@ -151,11 +151,11 @@ Makefile: qt.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mks
/usr/lib/libQtGui.prl: /usr/lib/libQtGui.prl:
/usr/lib/libQtCore.prl: /usr/lib/libQtCore.prl:
qmake: FORCE qmake: FORCE
@$(QMAKE) -o Makefile qt.pro @$(QMAKE) -unix -o Makefile qt.pro
dist: dist:
@$(CHK_DIR_EXISTS) .tmp/qt1.0.0 || $(MKDIR) .tmp/qt1.0.0 @$(CHK_DIR_EXISTS) .tmp/le-search1.0.0 || $(MKDIR) .tmp/le-search1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qt1.0.0/ && $(COPY_FILE) --parents categorize.h convert.h main.h mySearch.h readXml.h walk.h .tmp/qt1.0.0/ && $(COPY_FILE) --parents categorize.cpp convert.c main.cpp mySearch.cpp readXml.c walk.c .tmp/qt1.0.0/ && $(COPY_FILE) --parents mySearch.ui mySearchHelp.ui .tmp/qt1.0.0/ && (cd `dirname .tmp/qt1.0.0` && $(TAR) qt1.0.0.tar qt1.0.0 && $(COMPRESS) qt1.0.0.tar) && $(MOVE) `dirname .tmp/qt1.0.0`/qt1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qt1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/le-search1.0.0/ && $(COPY_FILE) --parents categorize.h convert.h main.h mySearch.h readXml.h walk.h .tmp/le-search1.0.0/ && $(COPY_FILE) --parents categorize.cpp convert.c main.cpp mySearch.cpp readXml.c walk.c .tmp/le-search1.0.0/ && $(COPY_FILE) --parents mySearch.ui mySearchHelp.ui .tmp/le-search1.0.0/ && (cd `dirname .tmp/le-search1.0.0` && $(TAR) le-search1.0.0.tar le-search1.0.0 && $(COMPRESS) le-search1.0.0.tar) && $(MOVE) `dirname .tmp/le-search1.0.0`/le-search1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/le-search1.0.0
clean:compiler_clean clean:compiler_clean
...@@ -170,8 +170,6 @@ distclean: clean ...@@ -170,8 +170,6 @@ distclean: clean
-$(DEL_FILE) Makefile -$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all mocables: compiler_moc_header_make_all compiler_moc_source_make_all
......
...@@ -19,9 +19,19 @@ void categorizeXml(const char *xmlFile, map<string, set<string> >& M) { ...@@ -19,9 +19,19 @@ void categorizeXml(const char *xmlFile, map<string, set<string> >& M) {
name = xmlTextReaderConstName(reader); name = xmlTextReaderConstName(reader);
if ( xmlTextReaderHasAttributes(reader) == 1 ) { if ( xmlTextReaderHasAttributes(reader) == 1 ) {
node.category = xmlTextReaderGetAttribute(reader, xmlCharStrdup("category")); node.category = xmlTextReaderGetAttribute(reader, xmlCharStrdup("category"));
node.media = xmlTextReaderGetAttribute(reader, xmlCharStrdup("media")); node.media = xmlTextReaderGetAttribute(reader, xmlCharStrdup("media"));
category = QString().fromLatin1((char *)node.category).toStdString(); category = QString().fromLatin1((char *)node.category).toStdString();
media = QString().fromLatin1((char *)node.media).toStdString(); media = QString().fromLatin1((char *)node.media).toStdString();
//Original
//category = QString().fromUtf8((char *)node.category).toStdString();
//media = QString().fromUtf8((char *)node.media).toStdString();
//Teste pra ver a saída na tela
// if ( string((char*)node.category) == "História" ) {
// cout << "node.category = " << node.category << endl;
// cout << "category = " << category << endl;
// }
M[media].insert(category); M[media].insert(category);
} }
ret = xmlTextReaderRead(reader); ret = xmlTextReaderRead(reader);
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
###################################################################### ######################################################################
TEMPLATE = app TEMPLATE = app
TARGET = TARGET = le-search
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . INCLUDEPATH += /usr/include/libxml2
LIBS += -lxml2
# Input # Input
HEADERS += categorize.h convert.h main.h mySearch.h readXml.h walk.h HEADERS += categorize.h convert.h main.h mySearch.h readXml.h walk.h
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment