[vdr] Converting from UTF-8 to ISO-8859-1

2008-05-18 Thread Joachim Wilke
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@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Converting from UTF-8 to ISO-8859-1

2008-05-18 Thread Klaus Schmidinger
On 05/18/08 18:27, Joachim Wilke wrote:
 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?

systemCharacterTable is only set if it is a single byte character set,
which UTF-8 is not.

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

Good, so it works as designed ;-)

Klaus

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


Re: [vdr] Converting from UTF-8 to ISO-8859-1

2008-05-18 Thread Joachim Wilke
2008/5/18 Klaus Schmidinger [EMAIL PROTECTED]:
 On 05/18/08 18:27, Joachim Wilke wrote:
 Is there a reason for this?

 systemCharacterTable is only set if it is a single byte character set,
 which UTF-8 is not.

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

 Good, so it works as designed ;-)

Hi Klaus,

so what do I have to do, to convert a string (from whatever encoding
VDR currently uses) to ISO-8859-1 ?

Do I really have to do:

  if(cCharSetConv::SystemCharacterTable == NULL)
cCharSetConv conv(UTF-8, ISO-8859-1);
  else
cCharSetConv conv(NULL, ISO-8859-1);
  const char *s_converted = conv.Convert(string);

This is against the generic use of NULL as parameter, in my opinion.

Regards,
Joachim.

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


[vdr] segmentation fault with Skins.QueueMessage

2008-05-18 Thread lukkinosat
Hello

I use the function Skins.QueueMessage from a
background thread.

Example:
Skins.QueueMessage( mtInfo, TEST, 40 );

I set a time of 40 seconds, but if time watchdog is
less than 40 seconds, vdr exit with a segmentation
fault.

Is this normal? Is possible set a message with a time
greater of time watchdog?

Luca

P.S. Sorry for my English


  ___ 
Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e la tua opinione!
http://www.ymailblogit.com/blog/

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


Re: [vdr] segmentation fault with Skins.QueueMessage

2008-05-18 Thread Joachim Wilke
2008/5/18 lukkinosat [EMAIL PROTECTED]:
 I use the function Skins.QueueMessage from a
 background thread.
 Skins.QueueMessage( mtInfo, TEST, 40 );

 I set a time of 40 seconds, but if time watchdog is
 less than 40 seconds, vdr exit with a segmentation
 fault.

 Is this normal?

Yes, because further handling of this message is done in the main thread.

 Is possible set a message with a time
 greater of time watchdog?

Multiple calls to QueueMessage with a shorter value for Seconds
should work as a workaround.

Best Regards,
Joachim.

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


Re: [vdr] segmentation fault with Skins.QueueMessage

2008-05-18 Thread Udo Richter
lukkinosat wrote:
 I set a time of 40 seconds, but if time watchdog is
 less than 40 seconds, vdr exit with a segmentation
 fault.
 Is this normal? Is possible set a message with a time
 greater of time watchdog?

It is. VDR 1.4.x even used a dirty workaround to display the 5 minute 
shutdown warning. (that is, calling signal(SIGALRM, SIG_IGN) before and 
signal(SIGALRM, Watchdog) after displaying the message.)
While the message is shown, VDR is completely blocked, not starting 
timers and similar stuff.

 From the main thread you can use mtStatus as type to display messages 
asynchronously. mtStatus messages will be shown without blocking until 
manually removed or overwritten.

Cheers,

Udo

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


Re: [vdr] Converting from UTF-8 to ISO-8859-1

2008-05-18 Thread Klaus Schmidinger
On 05/18/08 18:53, Joachim Wilke wrote:
 2008/5/18 Klaus Schmidinger [EMAIL PROTECTED]:
 On 05/18/08 18:27, Joachim Wilke wrote:
 Is there a reason for this?
 systemCharacterTable is only set if it is a single byte character set,
 which UTF-8 is not.

 The conversion works fine, if I use  UTF-8 instead of NULL:
   cCharSetConv conv(UTF-8, ISO-8859-1);
 Good, so it works as designed ;-)
 
 Hi Klaus,
 
 so what do I have to do, to convert a string (from whatever encoding
 VDR currently uses) to ISO-8859-1 ?
 
 Do I really have to do:
 
   if(cCharSetConv::SystemCharacterTable == NULL)
 cCharSetConv conv(UTF-8, ISO-8859-1);
   else
 cCharSetConv conv(NULL, ISO-8859-1);
   const char *s_converted = conv.Convert(string);
 
 This is against the generic use of NULL as parameter, in my opinion.

Actually this conversion wasn't necessary so far.
It was always about converting strings from some external character set
to the character set used by the system.

But I guess it should be ok to do this (modified lines marked with MOD):

cCharSetConv::cCharSetConv(const char *FromCode, const char *ToCode)
{
   if (!FromCode)
  FromCode = systemCharacterTable ? systemCharacterTable : UTF-8; //MOD
   if (!ToCode)
  ToCode = UTF-8;
   cd = iconv_open(ToCode, FromCode); //MOD
   result = NULL;
   length = 0;
}
...
const char *cCharSetConv::Convert(const char *From, char *To, size_t ToLength)
{
   if (From  *From) { //MOD


Please try this and let me know if it works and doesn't break anything else.

Klaus

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


Re: [vdr] CAM menu umlauts broken?

2008-05-18 Thread Hanno Zulla
Hi,

 on my e-tobi based 1.6 setup, the CAM menu umlauts are broken, while all
 the other menu items (that I checked so far) use the correct encoding.

 Is there a recoding missing between the CAM and the vdr OSD?

 What LANG environment are u using? Please look at your /etc/defaults/vdr 
 file.

VDR_LANG=de_DE.UTF-8
VDR_CHARSET_OVERRIDE=ISO-8859-1

 On my e-tobi based install, my cam don't have problems with de_DE.UTF-8

My setup (running on Ubuntu) shows broken Umlauts in the cam menu.

Regards,

Hanno

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