Rev 6021 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6021 | Rev 6045 | ||
---|---|---|---|
Line 133... | Line 133... | ||
133 | if (strstri(bufpointer, "html")) |
133 | if (strstri(bufpointer, "html")) |
134 | { |
134 | { |
135 | style.pre = 0; |
135 | style.pre = 0; |
136 | cur_encoding = CH_UTF8; |
136 | cur_encoding = CH_NULL; |
137 | } |
137 | } |
138 | else |
138 | else |
139 | { |
139 | { |
140 | style.pre = 1; |
140 | style.pre = 1; |
141 | cur_encoding = CH_CP866; |
141 | cur_encoding = CH_NULL; |
142 | } |
142 | } |
143 | for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
143 | for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
144 | { |
144 | { |
145 | if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
145 | if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
146 | bukva = ESBYTE[bufpos]; |
146 | bukva = ESBYTE[bufpos]; |
147 | switch (bukva) |
147 | switch (bukva) |
148 | { |
148 | { |
Line 366... | Line 366... | ||
366 | if (opened) |
366 | if (opened) |
367 | { |
367 | { |
368 | WB1.DrawBuf.zoom=2; |
368 | WB1.DrawBuf.zoom=2; |
369 | WB1.list.font_type |= 10111001b; |
369 | WB1.list.font_type |= 10011001b; |
370 | if (isattr("align=")) && (isval("center")) style.align = ALIGN_CENTER; |
370 | if (isattr("align=")) && (isval("center")) style.align = ALIGN_CENTER; |
371 | if (isattr("align=")) && (isval("right")) style.align = ALIGN_RIGHT; |
371 | if (isattr("align=")) && (isval("right")) style.align = ALIGN_RIGHT; |
372 | if (stroka>1) NewLine(); |
372 | if (stroka>1) NewLine(); |
373 | } |
373 | } |
374 | else |
374 | else |
375 | { |
375 | { |
376 | WB1.DrawBuf.zoom=1; |
376 | WB1.DrawBuf.zoom=1; |
377 | WB1.list.font_type = 10111000b; |
377 | WB1.list.font_type = 10011000b; |
378 | style.align = ALIGN_LEFT; |
378 | style.align = ALIGN_LEFT; |
379 | } |
379 | } |
380 | return; |
380 | return; |
381 | } |
381 | } |
382 | if (istag("dt")) { |
382 | if (istag("dt")) { |
383 | style.li = opened; |
383 | style.li = opened; |
384 | if (opened) NewLine(); |
384 | if (opened) NewLine(); |
Line 414... | Line 414... | ||
414 | return; |
414 | return; |
415 | } |
415 | } |
416 | if (istag("meta")) || (istag("?xml")) { |
416 | if (istag("meta")) || (istag("?xml")) { |
417 | do{ |
417 | meta_encoding = CH_NULL; |
418 | if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding=")) |
418 | do{ |
- | 419 | if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding=")) |
|
419 | { |
420 | { |
420 | strcpy(#val, #val[strrchr(#val, '=')]); //ïîèñê â content= |
421 | strcpy(#val, #val[strrchr(#val, '=')]); //ïîèñê â content= |
421 | strlwr(#val); |
422 | strlwr(#val); |
422 | if (isval("utf-8")) || (isval("utf8")) meta_encoding = CH_UTF8; |
423 | if (isval("utf-8")) || (isval("utf8")) meta_encoding = CH_UTF8; |
423 | else if (isval("koi8-r")) || (isval("koi8-u")) meta_encoding = CH_KOI8; |
424 | else if (isval("koi8-r")) || (isval("koi8-u")) meta_encoding = CH_KOI8; |
424 | else if (isval("windows-1251")) || (isval("windows1251")) meta_encoding = CH_CP1251; |
425 | else if (isval("windows-1251")) || (isval("windows1251")) meta_encoding = CH_CP1251; |
425 | else if (isval("iso-8859-5")) || (isval("iso8859-5")) meta_encoding = CH_ISO8859_5; |
426 | else if (isval("iso-8859-5")) || (isval("iso8859-5")) meta_encoding = CH_ISO8859_5; |
426 | else if (isval("dos")) || (isval("cp-866")) meta_encoding = CH_CP866; |
427 | else if (isval("dos")) || (isval("cp-866")) meta_encoding = CH_CP866; |
427 | if (cur_encoding!=meta_encoding) BufEncode(meta_encoding); |
428 | } |
428 | return; |
429 | } while(GetNextParam()); |
429 | } |
- | |
430 | } while(GetNextParam()); |
- | |
431 | return; |
430 | if (meta_encoding!=CH_NULL) BufEncode(meta_encoding); |
432 | } |
431 | return; |
- | 432 | } |
|
433 | } |
433 | } |
434 | 434 | ||
435 | void TWebBrowser::BufEncode(int set_new_encoding) |
435 | void TWebBrowser::BufEncode(int set_new_encoding) |
Line 436... | Line 436... | ||
436 | { |
436 | { |
437 | int bufpointer_realsize; |
437 | int bufpointer_realsize; |
438 | cur_encoding = set_new_encoding; |
438 | if (o_bufpointer==0) |
439 | if (o_bufpointer==0) |
- | |
440 | { |
439 | { |
441 | o_bufpointer = malloc(bufsize); |
440 | o_bufpointer = malloc(bufsize); |
442 | strcpy(o_bufpointer, bufpointer); |
441 | strcpy(o_bufpointer, bufpointer); |
443 | } |
442 | } |
444 | else |
443 | else |
445 | { |
444 | { |
446 | strcpy(bufpointer, o_bufpointer); |
445 | strcpy(bufpointer, o_bufpointer); |
447 | } |
446 | } |
448 | } |
447 | if (cur_encoding!=set_new_encoding) { |
- | 448 | cur_encoding = set_new_encoding; |
|
- | 449 | debugln(charsets[cur_encoding]); |
|
- | 450 | bufpointer = ChangeCharset(charsets[cur_encoding], "CP866", bufpointer); |
|
- | 451 | } |
|
- | 452 | } |
|
449 | //============================================================================================ |
453 | //============================================================================================ |
450 | void TWebBrowser::DrawScroller() |
454 | void TWebBrowser::DrawScroller() |
451 | { |
455 | { |
452 | scroll_wv.max_area = list.count; |
456 | scroll_wv.max_area = list.count; |
453 | scroll_wv.cur_area = list.visible; |
457 | scroll_wv.cur_area = list.visible; |