RE: [PATCH] Octstr support for converting to and from HTML 4 entities.
"Oded Arbel" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
> -----Original Message----- > From: Rene Kluwen [mailto:[email protected]] > 1. > Don't forget to include the octstr_insert_char patch either. > This code won't work without it (the patch). I do not believe > any code that > uses it works as it is now. > (a quick grep yielded that indeed there is no code, using it atm). already submitted to CVS - thanks for the fix, and sorry for not notifying you :-) > 2. > test_octstr_format: Where can I find this function? Its not a function, but a test program - you can find it under the test directory. I use it to test things with octstr instead of writing my own test program (I'm lazy - one of the three virtues of a programmer ;-) -- Oded Arbel m-Wise mobile solutions [email protected] +972-9-9581711 (116) +972-67-340014 ::.. The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" but "hm... that's funny..." -- Isaac Asimov > > > ----- Original Message ----- > Date: Mon September 23, 2002 04:55 PM > From: Oded Arbel <[email protected]> > To: Kannel-devel (E-mail) <[email protected]> > Subject: [PATCH] Octstr support for converting to and from > HTML 4 entities. > > Hi list. > > Here's the full HTML entity patch based on the work of Rene Kluwen > (Thanks !) > I only tested it to work as expected (both 'to' and 'from') > and that no > memory leaks are present - have not benchmarked it, but I > think that the > code > by Rene should prove much faster then my original hack. > > though this patch does not change any behaviour and is used > currently by no > part of the publicly available Kannel, I'd like to have a vote on its > usablity and cleanliness for inclusion in the CVS. > > the main changes from the patch submitted by Rene is > reogranization of the > two > last if statements in find_entity() into an if..else > statement in order to > make gcc happy, and a change to html-entities.def to include > the '<','>' > and > '"' entities with decimal values. > > P.S. > the test_octstr_format detects two memory leaks - from first > look I didn't > understand what is causing them. could someone familiar with > code please > take > a look ? > > -- > Oded Arbel > m-Wise mobile solutions > > On Monday 23 September 2002 04:13, Rene Kluwen / Chimit > Software Solutions > wrote: > > Hello list, > > > > So I took my own challenge (I was bored ;]). > > (Sorry, I will try to stick with only one patch for the > same thing, next > > time I post it.) > > > > Advantages of this patch over the previous one: > > - It is faster, because it uses a binary search (didn't really bench > > mark it though). > > - It is less lines of code (so better to read and less > chance on bugs) > > - It doesn't rely on c-strings, except for the oct_str functions. > > - The oct_str functions are also used for comparing, hencing porting > > to other locales does not impose a problem. > > > > In principle, octstr_convert_to_html_entities could be made > as fast by > > binary searching the table as well. But it requires sorting > the table. > > If the compiler optimizes well enough (which it does), > generating the > > entities-table does not require cpu seconds at run-time. > > > > -- Rene... > > >