[Kepler-Project] lxp.lom parser problem

Luís Eduardo Jason Santos jasonsantos at gmail.com
Fri Dec 14 16:44:39 GMT+3 2007


Do you really need to _handle_ them in Lua? I mean, are you going to do
things like count words, sort values, etc, in Lua?

'cause if you're not, you could just carry the string as it is directly to,
let's say, a web browser - that will know what to do when the UTL-8 string
is given to it.

On Dec 14, 2007 4:17 PM, Rafael Sabbagh Armony <sabbagh at gmail.com> wrote:

> Ok, it really seams that LOM (LuaExpat) uses UTF-8 to represent text
> inside the LOM table.
>
> And now there seams to be another problem: how to handle UTF-8 strings in
> Lua...
>
> As far as I could find out, Lua has no functions to deal with that.
>
> So, if I want to extract text contents of a LOM table (something obvious
> to be done), it can't be done correctly, unless I have convertion functions
> which, as far as I know, are not available.
>
> Does anybody have them? Any other solution?
>
>
>
> Cheers,
>    Rafael Sabbagh Armony
>
> 2007/12/11, Ignacio Burgueño <ignaciob at inconcertcc.com>:
>
> > Rafael Sabbagh Armony wrote:
> > > Javier,
> > >
> > > I've made an experience providing the encoding header. I wrote:
> > >
> > > local XMLStr = [[<?xml version="1.0" encoding="ISO-8859-1"?>
> > > <a>á é í ó ú</a>]]
> > >
> > > require "lxp.lom"
> > > local lomTable = lxp.lom.parse(XMLStr)
> > >
> > > The result is the LOM table:
> > >
> > > { "á Ã(c) í ó ú", ["attr"] = { }, ["tag"] = "a", }
> > >
> > >
> >
> > From the looks of the returned string, it seems that the output is
> > UTF-8 encoded.
> >
> >
> >
> > _______________________________________________
> > Kepler-Project mailing list
> > Kepler-Project at lists.luaforge.net
> > http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> > http://www.keplerproject.org/
> >
>
>
> _______________________________________________
> Kepler-Project mailing list
> Kepler-Project at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>



-- 
Luís Eduardo Jason Santos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.luaforge.net/pipermail/kepler-project/attachments/20071214/f2c87587/attachment.html


More information about the Kepler-Project mailing list