Re: libseed-list Defining a gchar in seed?
- From: "Alan Knowles" <alan akbkhome com>
- To: "Tim Horton" <libseed-list-bounces gnome org>
- Cc: libseed-list gnome org, alfraealba googlemail com
- Subject: Re: libseed-list Defining a gchar in seed?
- Date: Tue, 09 Feb 2010 07:38:45 +0800
Anaylsis of issue alfra found (As far as I understand.)
text = "a";
text = glib.ascii_toupper(text);
should not really work: the prototype for this is to accept a 'char'
'text' is a char[] type, not really a char in the C sense.
I'm not sure if Javascript should go as far as auto-type converting single char arrays to char's.
The equivilant in Javascript:
String.fromCharCode(65); // returns 'A"
String.fromCharCode('a'); // returns empty string..
So I think the current behaviour is consistent with the expected behaviour in Javascript.
Regards
Alan
--- On 09/Feb/2010, Tim Horton wrote:
> While Alan is right in that JavaScript should have most of what you need UTF-wise, that's no reason for us to get this wrong (those functions *should* be made to work, you weren't wrong to try to use them). I'll take a look at it when I get a chance (if I don't respond within a few days, file a bug so that I don't forget - or, you can do that anyway).
>
> --Tim
>
> On Feb 8, 2010, at 12:54, alsaf wrote:
>
> > Thanks Alan.
> >
> > I'll definitely have a closer look at this as it looks most helpful. As
> > I mentioned, I am just having a look at the glib library and not sure if
> > these character based functions would be used in a real-life situation
> > as I had used them but it is worth knowing for curiosities sake.
> >
> >
> >
> >
> >> ----------------------------------------------------------------------
> >>
> >> Message: 1
> >> Date: Sun, 07 Feb 2010 22:16:42 +0800
> >> From: "Alan Knowles" <alan akbkhome com>
> >> To: "alsaf" <libseed-list-bounces gnome org>
> >> Cc: libseed-list gnome org
> >> Subject: Re: libseed-list Defining a gchar in seed?
> >> Message-ID: <2f657cdefe2d82c9c28c5f0d8d7cb361-*LOGS akbkhome com>
> >> Content-Type: text/plain; charset=ISO-8859-1
> >>
> >> Javascript is UTF friendly - you should probably look at the native functions for this -
> >> https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String
> >>
> >> Regards
> >> Alan
> >>
> >> --- On 07/Feb/2010, alsaf wrote:
> >>> I've found a command to convert from utf-8 to char:
> >>>
> >>> glib.utf8_get_char("a");
> >>>
> >>> But unable to find one that does it the other way. I see there is a
> >>> command called glib.convert but that does string but is there one for
> >>> characters?
> >>>
> >>> _______________________________________________
> >>> libseed-list mailing list
> >>> libseed-list gnome org
> >>> http://mail.gnome.org/mailman/listinfo/libseed-list
> >>
> >>
> >>
> >> ------------------------------
> >>
> >> _______________________________________________
> >> libseed-list mailing list
> >> libseed-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/libseed-list
> >>
> >>
> >> End of libseed-list Digest, Vol 5, Issue 3
> >> ******************************************
> >
> >
> > _______________________________________________
> > libseed-list mailing list
> > libseed-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libseed-list
>
> _______________________________________________
> libseed-list mailing list
> libseed-list gnome org
> http://mail.gnome.org/mailman/listinfo/libseed-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]