encoding = gconf_get_string (gconf_client, "subtitle_encoding");
if (encoding) {
- /* skip current locale */
- gint index = 1;
+ gint index = 0;
while (index < SUBTITLE_ENCODING_LAST) {
- if (strcmp (encodings[index].charset, encoding) == 0) {
- hildon_picker_button_set_active (HILDON_PICKER_BUTTON (button),
- index);
- break;
+ if (encodings[index].charset) {
+ if (strcmp (encodings[index].charset, encoding) == 0) {
+ hildon_picker_button_set_active (HILDON_PICKER_BUTTON (button),
+ index);
+ break;
+ }
}
index++;
}