HTMLv: 0.99.73: if document has no encoding UTF will be used

git-svn-id: svn://kolibrios.org@4648 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2014-03-15 11:43:07 +00:00
parent 0332630c73
commit a5d1f788b7
2 changed files with 7 additions and 7 deletions

View File

@ -305,10 +305,8 @@ void TWebBrowser::Parse(){
TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
} }
DrawPage(); DrawPage();
line=NULL;
line=NULL;
if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ
tag = parametr = tagparam = ignor_param = NULL; tag = parametr = tagparam = ignor_param = NULL;
break; break;
default: default:
@ -419,9 +417,10 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
DrawBuf.Fill(bg_color); DrawBuf.Fill(bg_color);
} }
} while(GetNextParam()); } while(GetNextParam());
if (opened) if (opened) && (cur_encoding==_DEFAULT)
{ {
if (cur_encoding==_DEFAULT) BufEncode(_UTF); //if no encoding specified it would be UTF debugln("Document has no information about encoding, UTF will be used");
BufEncode(_UTF);
} }
return; return;
} }
@ -637,6 +636,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
{ {
strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content= strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content=
strlwr(#options); strlwr(#options);
meta_encoding = _DEFAULT;
if (!strcmp(#options, "utf-8")) || (!strcmp(#options,"utf8")) meta_encoding = _UTF; if (!strcmp(#options, "utf-8")) || (!strcmp(#options,"utf8")) meta_encoding = _UTF;
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) meta_encoding = _KOI; if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) meta_encoding = _KOI;
if (!strcmp(#options, "windows-1251")) || (!strcmp(#options, "windows1251")) meta_encoding = _WIN; if (!strcmp(#options, "windows-1251")) || (!strcmp(#options, "windows1251")) meta_encoding = _WIN;

View File

@ -30,14 +30,14 @@
#include "img\URLgoto.txt"; #include "img\URLgoto.txt";
#ifdef LANG_RUS #ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.72"; char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.73";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤" ?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>"; char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm"; unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n\0"; char accept_language[]= "Accept-Language: ru\n\0";
#else #else
char version[]=" Text-based Browser 0.99.72"; char version[]=" Text-based Browser 0.99.73";
?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last" ?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>"; char loading[] = "Loading...<br>";