Re: [Nautilus-list] i18n for web page titles



Christopher Blizzard <blizzard redhat com> writes:
> > widget/src/gtk/nsWindow.cpp,
> >  NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle)
> > converts directly to an X property and bypasses
> > gtk_window_set_title()
> > entirely. Blah.
> 
> 
> They wouldn't use the same APIs anyway.

I was wrong about this it turns out, it does convert to locale
encoding before passing to the X functions. It's only using X because
GTK doesn't work around twm very
well. (http://bugzilla.gnome.org/show_bug.cgi?id=59175)
 
> I don't want to change the behaviour for callers that might already be
> doing iconv(). 

On get_title()? There is absolutely no working usage of this function
- the return value (Latin-1) has hopelessly lost the necessary
information. Anyone using get_title() has broken code. Calling iconv()
on the result doesn't do anything of interest; it just converts
gibberish to more gibberish.

Galeon looks like it's using get_title_unichar() so it may not matter
though, perhaps no one is using get_title().

> You should be able to take the PRUnichar * type and
> use NS_ConvertUCS2ToUTF8() to get the UTF-8 string out of it.
> 
> PRUnchar *title;
> gtk_moz_embed_get_title_unichar(&title);
> if (title) {
>    NS_ConvertUCS2ToUTF8 utf8_title(title);
>    char *title_char_utf8 = utf8_title.get();
>    /* convert */
>    ...
>    gtk_window_set_title(end_var);
> }

Yes, I understand that. I'm not talking about changing
get_title_unichar()

Rather I'm saying get_title() should return text in the same encoding
every other GTK 1.2 widget get_foo() function returns it in.

In Galeon, src/mozilla.cpp:mozilla_get_document_title() contains this
code already. I can put it in Nautilus, I was just hoping to fix it in
several places at once.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]