added support for UTF-8
now the UTF-8 is a default charset git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,23 +1,32 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
notify.o: templatesnotify.h ../../ezc/src/ezc.h ../core/mount.h
|
||||
notify.o: ../core/locale.h ../core/confparser.h ../core/config.h
|
||||
notify.o: ../core/htmlfilter.h ../templates/misc.h
|
||||
notify.o: ../templates/localefilter.h ../core/locale.h ../core/user.h
|
||||
notify.o: ../core/notify.h ../templatesnotify/templatesnotify.h
|
||||
notify.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
notify.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
notify.o: templatesnotify.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
notify.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
notify.o: ../../ezc/src/item.h ../../ezc/src/stringconv.h
|
||||
notify.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h ../core/mount.h
|
||||
notify.o: ../core/config.h ../core/confparser.h ../core/htmlfilter.h
|
||||
notify.o: ../core/textstream.h ../core/misc.h ../templates/misc.h
|
||||
notify.o: ../templates/localefilter.h ../templates/locale.h
|
||||
notify.o: ../core/confparser.h ../core/user.h ../core/notify.h
|
||||
notify.o: ../templatesnotify/templatesnotify.h ../core/request.h
|
||||
notify.o: ../core/requesttypes.h ../core/session.h ../core/error.h
|
||||
notify.o: ../core/log.h ../core/textstream.h ../core/user.h
|
||||
notify.o: ../core/plugindata.h ../core/rebus.h ../core/config.h
|
||||
notify.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h ../db/db.h
|
||||
notify.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
notify.o: ../core/textstream.h ../core/error.h ../db/dbitemquery.h
|
||||
notify.o: ../core/item.h ../db/dbitemcolumns.h ../core/group.h
|
||||
notify.o: ../core/thread.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
notify.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
|
||||
notify.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
|
||||
notify.o: ../core/groups.h ../core/group.h ../core/loadavg.h
|
||||
templatesnotify.o: templatesnotify.h ../../ezc/src/ezc.h ../core/mount.h
|
||||
templatesnotify.o: ../core/locale.h ../core/confparser.h ../core/config.h
|
||||
templatesnotify.o: ../core/htmlfilter.h ../templates/misc.h
|
||||
templatesnotify.o: ../templates/localefilter.h ../core/locale.h
|
||||
templatesnotify.o: ../core/user.h ../core/misc.h ../core/item.h ../core/log.h
|
||||
notify.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
notify.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
notify.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
|
||||
notify.o: ../core/ugcontainer.h ../core/mounts.h ../core/mount.h
|
||||
notify.o: ../core/mountparser.h ../core/users.h ../core/ugcontainer.h
|
||||
notify.o: ../core/lastcontainer.h ../core/groups.h ../core/group.h
|
||||
notify.o: ../core/loadavg.h
|
||||
templatesnotify.o: templatesnotify.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
templatesnotify.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
templatesnotify.o: ../../ezc/src/item.h ../../ezc/src/stringconv.h
|
||||
templatesnotify.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
templatesnotify.o: ../core/mount.h ../core/config.h ../core/confparser.h
|
||||
templatesnotify.o: ../core/htmlfilter.h ../core/textstream.h ../core/misc.h
|
||||
templatesnotify.o: ../templates/misc.h ../templates/localefilter.h
|
||||
templatesnotify.o: ../templates/locale.h ../core/confparser.h ../core/user.h
|
||||
templatesnotify.o: ../core/misc.h ../core/log.h ../core/textstream.h
|
||||
templatesnotify.o: ../templates/locale.h
|
||||
|
@@ -9,9 +9,9 @@
|
||||
|
||||
#include "templatesnotify.h"
|
||||
#include "core/misc.h"
|
||||
#include "core/locale.h"
|
||||
#include "core/log.h"
|
||||
|
||||
#include "core/textstream.h"
|
||||
#include "templates/locale.h"
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ int mount_type_ticket;
|
||||
|
||||
|
||||
Patterns patterns;
|
||||
Ezc::Functions ezc_functions;
|
||||
Ezc::Functions<TextStream<std::wstring> > ezc_functions;
|
||||
Locale locale;
|
||||
LocaleFilter locale_filter;
|
||||
|
||||
@@ -104,8 +104,9 @@ using namespace TemplatesNotifyFunctions;
|
||||
locale.SetLang(Locale::lang_en);
|
||||
|
||||
ClearPatterns();
|
||||
locale.UTF8(config->utf8);
|
||||
locale.Read(config->locale_dir, config->locale_dir_default);
|
||||
TemplatesFunctions::Read(patterns, pat_email_notify, locale, locale_filter, "notify_email.txt", true);
|
||||
TemplatesFunctions::Read(patterns, pat_email_notify, locale, locale_filter, L"notify_email.txt", true);
|
||||
|
||||
notify_msg = 0;
|
||||
}
|
||||
@@ -116,7 +117,7 @@ void TemplatesNotify::Generate(Locale::Lang lang)
|
||||
{
|
||||
using namespace TemplatesNotifyFunctions;
|
||||
|
||||
notify_str.str("");
|
||||
notify_str.Clear();
|
||||
|
||||
if( !notify_msg )
|
||||
return;
|
||||
@@ -127,7 +128,7 @@ using namespace TemplatesNotifyFunctions;
|
||||
return;
|
||||
}
|
||||
|
||||
Ezc::Generator generator(notify_str, patterns[lang][pat_email_notify], ezc_functions);
|
||||
Ezc::Generator<TextStream<std::wstring> > generator(notify_str, patterns[lang][pat_email_notify], ezc_functions);
|
||||
generator.RecognizeSpecialChars(true);
|
||||
generator.TrimWhite(true);
|
||||
generator.SkipNewLine(true);
|
||||
|
@@ -15,21 +15,21 @@
|
||||
#include <string>
|
||||
#include "ezc.h"
|
||||
#include "core/mount.h"
|
||||
#include "core/locale.h"
|
||||
#include "core/config.h"
|
||||
#include "core/textstream.h"
|
||||
#include "templates/misc.h"
|
||||
|
||||
|
||||
|
||||
struct NotifyMsg
|
||||
{
|
||||
std::string email;
|
||||
std::wstring email;
|
||||
int notify_code;
|
||||
int current_mount_type;
|
||||
Locale::Lang lang;
|
||||
std::string doc_base_url;
|
||||
std::string item_dir;
|
||||
std::string item_link;
|
||||
std::wstring doc_base_url;
|
||||
std::wstring item_dir;
|
||||
std::wstring item_link;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ namespace TemplatesNotifyFunctions
|
||||
extern int mount_type_thread;
|
||||
extern int mount_type_ticket;
|
||||
|
||||
|
||||
using Ezc::Info;
|
||||
using TemplatesFunctions::Info;
|
||||
|
||||
enum Pat {
|
||||
pat_email_notify = 0, // first should be zero
|
||||
@@ -85,7 +84,7 @@ public:
|
||||
void CreateFunctions();
|
||||
void Generate(Locale::Lang lang);
|
||||
|
||||
std::ostringstream notify_str;
|
||||
TextStream<std::wstring> notify_str;
|
||||
|
||||
private:
|
||||
|
||||
@@ -93,7 +92,7 @@ private:
|
||||
void Read(TemplatesNotifyFunctions::Pat pat, const char * file);
|
||||
void ClearPatterns();
|
||||
|
||||
std::string temp;
|
||||
std::wstring temp;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user