Converting from UTF-8 to ISO-8859-1

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

 



Dear experts,

I am currently trying to convert a string to ISO-8859-1 using the
following code fragment:

  cCharSetConv conv(NULL, "ISO-8859-1");
  const char *s_converted = conv.Convert(string);

Running VDR with UTF-8, this conversion failes (i.e., s_converted == string).
This is due to the fact, that cCharSetConv::SystemCharacterTable contains "NULL"
instead of "UTF-8". This is because systemCharacterTable is never set:

void cCharSetConv::SetSystemCharacterTable(const char *CharacterTable)
{
  free(systemCharacterTable);
  systemCharacterTable = NULL;
  if (!strcasestr(CharacterTable, "UTF-8")) {
     ..
     systemCharacterTable = strdup(CharacterTable);
     }
}

Is there a reason for this?

The conversion works fine, if I use  "UTF-8" instead of "NULL":
  cCharSetConv conv("UTF-8", "ISO-8859-1");


Best Regards,
Joachim.

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux