mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 22:29:26 +03:00
[project @ 2002-09-11 21:19:24 by bursa]
Convert all text to iso-8859-1 (temporary fix). svn path=/import/netsurf/; revision=35
This commit is contained in:
parent
0380dbb75d
commit
1e5061507b
10
makefile
10
makefile
@ -1,4 +1,4 @@
|
||||
# $Id: makefile,v 1.2 2002/09/11 14:24:02 monkeyson Exp $
|
||||
# $Id: makefile,v 1.3 2002/09/11 21:19:24 bursa Exp $
|
||||
|
||||
all: netsurf,ff8
|
||||
clean:
|
||||
@ -8,7 +8,8 @@ FLAGS = -g -Wall -W -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual \
|
||||
-Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -std=c9x \
|
||||
-I.. -I../../Tools/libxml2/include -I../../Tools/oslib \
|
||||
-I../../Tools/curl/include -Dfd_set=long -mpoke-function-name
|
||||
-I../../Tools/curl/include -I../../Tools/libutf-8 \
|
||||
-Dfd_set=long -mpoke-function-name
|
||||
CC = riscos-gcc
|
||||
OBJECTS = render/objs-riscos/utils.o render/objs-riscos/css.o \
|
||||
render/objs-riscos/css_enum.o render/objs-riscos/box.o \
|
||||
@ -19,13 +20,14 @@ OBJECTS = render/objs-riscos/utils.o render/objs-riscos/css.o \
|
||||
HEADERS = render/box.h render/css.h render/css_enum.h \
|
||||
render/layout.h render/utils.h riscos/font.h riscos/gui.h \
|
||||
desktop/browser.h desktop/fetch.h desktop/gui.h desktop/netsurf.h
|
||||
LIBS = ../../Tools/libxml2/libxml.ro ../../Tools/oslib/oslib.o ../../Tools/curl/libcurl.ro
|
||||
LIBS = ../../Tools/libxml2/libxml.ro ../../Tools/oslib/oslib.o \
|
||||
../../Tools/curl/libcurl.ro ../../Tools/libutf-8/libutf-8.ro
|
||||
|
||||
netsurf,ff8: $(OBJECTS)
|
||||
$(CC) $(FLAGS) -o netsurf,ff8 $(OBJECTS) $(LIBS)
|
||||
|
||||
render/css_enum.c render/css_enum.h: render/css_enums render/makeenum
|
||||
render/makeenum render/css_enum < render/css_enums
|
||||
cd ..; netsurf/render/makeenum netsurf/render/css_enum < netsurf/render/css_enums
|
||||
|
||||
render/objs-riscos/%.o: render/%.c $(HEADERS)
|
||||
$(CC) $(FLAGS) -o $@ -c $<
|
||||
|
23
render/box.c
23
render/box.c
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id: box.c,v 1.13 2002/09/11 14:24:02 monkeyson Exp $
|
||||
* $Id: box.c,v 1.14 2002/09/11 21:19:24 bursa Exp $
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -8,6 +8,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libxml/HTMLparser.h"
|
||||
#include "utf-8.h"
|
||||
#include "netsurf/render/css.h"
|
||||
#include "netsurf/render/font.h"
|
||||
#include "netsurf/render/box.h"
|
||||
@ -73,6 +74,24 @@ struct box * box_create(xmlNode * node, box_type type, struct css_style * style,
|
||||
return box;
|
||||
}
|
||||
|
||||
|
||||
char * tolat1(const xmlChar * s)
|
||||
{
|
||||
char *d = xcalloc(strlen(s) + 1, sizeof(char));
|
||||
char *d0 = d;
|
||||
unsigned int u, chars;
|
||||
|
||||
while (*s != 0) {
|
||||
u = sgetu8(s, &chars);
|
||||
s += chars;
|
||||
*d = u < 0x100 ? u : '?';
|
||||
d++;
|
||||
}
|
||||
*d = 0;
|
||||
|
||||
return d0;
|
||||
}
|
||||
|
||||
/**
|
||||
* make a box tree with style data from an xml tree
|
||||
*
|
||||
@ -147,7 +166,7 @@ struct box * convert_xml_to_box(xmlNode * n, struct css_style * parent_style,
|
||||
}
|
||||
if (n->type == XML_TEXT_NODE) {
|
||||
box = box_create(n, BOX_INLINE, parent_style, href);
|
||||
box->text = squash_whitespace((char *) n->content);
|
||||
box->text = squash_whitespace(tolat1(n->content));
|
||||
box->length = strlen(box->text);
|
||||
box_add_child(inline_container, box);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user