Sign in to follow this  
Followers 0
musosoft

Diacritic problem

4 posts in this topic

I am from slovakia and on hub where i going is disallow to write diacritic (ľščťžýáíé...) but apex dc deleting only some chars not all. How i fix this problem ? (Sorry for my english :)

Share this post


Link to post
Share on other sites

Remove Diacritic marks from Czech characters in File > Settings > Appearance?

Share this post


Link to post
Share on other sites

Remove Diacritic marks from Czech characters in File > Settings > Appearance?

Yes I did it. But some charakters is with diacritic... :crying: in strongdc is removed all diacritic chars...

Share this post


Link to post
Share on other sites

Try to recompile ApexDC on machine with slovak locale and arrayutf copied from StrongDC source, maybe it'll help.

PS: Personally I think this kinda way would be better when removing diacritic marks:

WinUtil.cpp

wchar_t arraydblutf[12] = { L'\xe4' ,L'\xf1' ,L'\xf6' ,L'\xfc' ,L'\xff' ,L'\x00df' ,L'\x00c6' ,L'\x00e6' ,L'\x0132' ,L'\x0133' ,L'\x0152' ,L'\x0153' };

vector<tstring> arraydblwin(12);

arraydblwin.push_back(L"ae");

arraydblwin.push_back(L"ny");

arraydblwin.push_back(L"oe");

arraydblwin.push_back(L"ue");

arraydblwin.push_back(L"yu");

arraydblwin.push_back(L"ss");

arraydblwin.push_back(L"AE");

arraydblwin.push_back(L"ae");

arraydblwin.push_back(L"IJ");

arraydblwin.push_back(L"ij");

arraydblwin.push_back(L"Oe");

arraydblwin.push_back(L"oe");


wchar_t arrayutf[22] =  { L'\x00d0' ,L'\x0110' ,L'\x00f0' ,L'\x0111' ,L'\x0126' ,L'\x0127' ,L'\x0131' ,L'\x0138' ,L'\x013f' ,L'\x0141' ,L'\x0140' ,L'\x0142' ,L'\x014a' ,L'\x0149' ,L'\x014b' ,L'\x00d8' ,L'\x00f8' ,L'\x017f' ,L'\x00de' ,L'\x0166' ,L'\x00fe' ,L'\x0167 };

wchar_t arraywin[22] = { L'D' ,L'D' ,L'd' ,L'd' ,L'H' ,L'h' ,L'i' ,L'k' ,L'L' ,L'L' ,L'l' ,L'l' ,L'N' ,L'n' ,L'n' ,L'O' ,L'o' ,L's' ,L'T' ,L'T' ,L't' ,L't };


const tstring& WinUtil::disableCzChars(tstring& message) {

	//Here we must check if locale is really contain removed diacritic (maybe switch(locale) {... //removal... default: return message; } would suit)

	//Then array of removed chars must vary for each locale.

	//...

	//Let's remove them

	for(size_t j = 0; j < message.length(); j++) {

		for(size_t l = 0; l < (sizeof(arrayutf) / sizeof(arrayutf[0])); l++) {

			if (message[j] == arrayutf[l]) {

				message[j] = arraywin[l];

				break;

			}

		}

		for(size_t l = 0; l < arraydblwin.size(); l++) {

			if (message[j] == arraydblutf[l]) {

				message.erase(j,1);

				message.insert(j,arraydblwin[l]);

				j++;

				break;

			}

		}		

	}


	return message;

}

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0