1
/******************************************************************************
3
* UTF8Cantillation - SWFilter descendant to remove UTF-8 Hebrew cantillation
10
#include <utf8cantillation.h>
14
const char oName[] = "Hebrew Cantillation";
15
const char oTip[] = "Toggles Hebrew Cantillation Marks";
17
const SWBuf choices[3] = {"On", "Off", ""};
18
const StringList oValues(&choices[0], &choices[2]);
20
UTF8Cantillation::UTF8Cantillation() : SWOptionFilter(oName, oTip, &oValues) {
21
setOptionValue("Off");
25
UTF8Cantillation::~UTF8Cantillation(){};
28
char UTF8Cantillation::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
30
//The UTF-8 range 0xD6 0x90 to 0xD6 0xAF and 0xD7 0x84 consist of Hebrew cantillation marks so block those out.
32
const unsigned char* from = (unsigned char*)orig.c_str();
33
for (text = ""; *from; from++) {
35
if (*from == 0xD7 && *(from + 1) == 0x84) {
42
else if (*(from + 1) < 0x90 || *(from + 1) > 0xAF) {