Subversion Repositories Kolibri OS

Rev

Rev 7945 | Rev 7960 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7945 Rev 7957
Line 1... Line 1...
1
/* 
1
/* 
2
	Quark Code Edit v0.2
2
	Quark Code Edit
3
	Author: Kiril Lipatov aka Leency
3
	Author: Kiril Lipatov aka Leency
4
	Licence: GPLv2
4
	Licence: GPLv2
Line 5... Line 5...
5
 
5
 
6
	The core components of this app are:
6
	The core components of this app are:
Line 430... Line 430...
430
 
430
 
431
void EventChangeCharset(dword id)
431
void EventChangeCharset(dword id)
432
{
432
{
433
	if (param[0]=='\0') return;
433
	if (param[0]=='\0') return;
434
	user_encoding = id;
434
	user_encoding = id;
435
	LoadFile(#openfile_path);
435
	LoadFile(#param);
436
	ParseAndPaint();
436
	ParseAndPaint();
437
	draw_window();
437
	draw_window();
Line 438... Line 438...
438
}
438
}
Line 600... Line 600...
600
	if (real_encoding == CH_AUTO) {
600
	if (real_encoding == CH_AUTO) {
601
		real_encoding = CH_CP866;
601
		real_encoding = CH_CP866;
602
		if (strstr(io.buffer_data, "\208\190")) real_encoding = CH_UTF8;
602
		if (strstr(io.buffer_data, "\208\190")) real_encoding = CH_UTF8;
603
		else {
603
		else {
604
			if (chrnum(io.buffer_data, '\246')>5) 
604
			if (chrnum(io.buffer_data, '\246')>5) 
605
			|| (strstr(io.buffer_data, "пр")) real_encoding = CH_CP1251;
605
			|| (strstr(io.buffer_data, "\239\240")) real_encoding = CH_CP1251;
606
		}
606
		}
607
	}
607
	}
608
	if (real_encoding != CH_CP866) 
608
	if (real_encoding != CH_CP866) {
609
		ChangeCharset(real_encoding, "CP866", io.buffer_data);		
609
		ChangeCharset(real_encoding, "CP866", io.buffer_data);		
610
}
610
	}
-
 
611
}
Line 611... Line 612...
611
 
612
 
612
void LoadFile(dword f_path) 
613
void LoadFile(dword f_path) 
613
{
614
{
614
	if (io.buffer_data) free(io.buffer_data);
615
	if (io.buffer_data) free(io.buffer_data);