Loggytronic Forum

VOMP => VOMP General / MVP => Topic started by: JTe on February 17, 2012, 19:56:35

Title: UTF-8 hack for Vomp client
Post by: JTe on February 17, 2012, 19:56:35
Because the new 1.7.x VDR works well only with UTF-8 I made up a UTF-8 hack for Vomp client (0.3.1-2-Yaris).

This is really just a hack and the idea is to change the UTF-8 codec to ISO-8859-1 only just before printing the text on the screen. All the string handling except printing (and justifying) is in UTF-8 and just when the characters are placed on the screen they are converted to Latin characters of vomp client. The characters that cannot be converted (are not part of the ISO-8859-1) are replaced by [space], because that looks best on the screen (there is a small 'feature' in my code that it sometimes leaves one byte of a multibyte utf8 character at the end of the string, so this kind of fixes it the dirty way...)

You have to patch the client with attached patch, and also remember to convert the translation files to utf8 in l10n by running:

iconv -f iso-8859-1 -t utf-8 main-xx > newfile;cp newfile main-xx

where you replace xx with your language code.

The patch adds to a "Advanced" configuration menu a item "Use UTF-8 conversion" where you can select the utf-8 encoding (just for backwards compatibility). The default will be the old ISO-8859-1.

And of course you have to enable utf-8 on the vdr side and have the recordings directory in utf-8, etc.

I really hope the attached patch is complete as I just upgraded my development server to 64 bit squeeze and I do not manage to compile a client dongle anymore... I am not getting any error messages, but the dongle file is 4064 bytes shorter than before and will not load, so I guess there is something with the 64 bit environment that brakes the scripts. I have to investigate that more.

Anyway I have been testing this now for 4 weeks and I have had no crashes, nor other problems!
Title: Re: UTF-8 hack for Vomp client
Post by: odin4242 on April 25, 2012, 07:22:37
Hi JTe,

since i don't get the build environment for the dongle to run on my VDR, could you please post a new dongle including the UTF-8 patch? Version 0.3.1-3-Yaris would be cool ;)

Thanks in advance
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on May 02, 2012, 20:45:50
My current client version is vomp-dongle-0.3.1-2.2 which is based on version 0.3.1-2-Yaris with the following patches:

- Display and timing improvements while playing some recordings. (Thanks to MartenR) / from 0.3.1-3-Yaris
- Set teletext updates to a higher value that it works more responsive.  / from 0.3.1-3-Yaris
- My subtitle patch
- My utf8 hack
- added few missing tr() -calls to make the translations to work better

As there is the 2M limit to attachments I am trying to upload the client split in two parts, so download attached file "vomp-dongle-xaa" and the one attached to my next message "vomp-dongle-xab" and cat them together with the following command:

cat vomp-dongle-xaa vomp-dongle-xab > vomp-dongle

Title: Re: UTF-8 hack for Vomp client
Post by: JTe on May 02, 2012, 20:46:42
The second part is here...
Title: Re: UTF-8 hack for Vomp client
Post by: 4ndreas on May 06, 2012, 10:20:38
Hi JTe,

thank you very much for your work! Your Dongle solves a small problem I had with vomp-dongle-0.3.1-3-Yaris: I can use all fast forward speeds now (with 0.3.1-3 16x and 32x don't work).

But I can't get the UTF8 encoding work. I have vompserver 0.3.1-3-Yaris (I can't find version 0.3.1-2-Yaris) which I leave untouched. I changed the configuration to use your dongle file and I converted the file main-de in /video/plugins/vompserver/l10n (no changes made in vdr-1.7.27/PLUGINS/src/vompserver-0.3.1-3-Yaris/l10n).  I restarted the MVP and it shows the correct version on the screen. All functions work as before but the texts are still shown with no conversion of the UTF8 characters (I see two "ugly" characters instead of one Umlaut).

What am I doing wrong?

regards,
4ndreas

OS: opensuse 12.1
VDR: 1.7.27
vompserver: 0.3.1-3-Yaris
vompclient: as posted by JTe on May 02, 2012
Title: Re: UTF-8 hack for Vomp client
Post by: 4ndreas on May 06, 2012, 12:40:25
Hi JTe,

just forget my posting  ::)
I looked at the setup but did not change anything as it looked fine. Now I switched the UTF8 conversion from On to Off to On again and now it's working as expected! Sorry for the confusion.

regards,
4ndreas
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on May 06, 2012, 18:07:01
I guess I have a small bug on the default value of the UTF8 encoding selection if you had to do that... I will check it. And thanks for pointing it out as I never tested the dongle on a fresh install!

-Jussi
Title: Re: UTF-8 hack for Vomp client
Post by: Chris on May 31, 2012, 20:39:21
Hi all..

Marten sent me a UTF8 patch and urged me to apply it to the server code. It all works server side and sends ISO-8859 to clients by default unless it is asked by the client to send UTF8. I believe this is different to the way your patch works? I'm glad there's still interest in making vomp better!
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on May 31, 2012, 21:22:09
Yes, it is a different and most likely better approach as you do not need to compile client side dongle, which is difficult for many people. My patch makes the UTF8 - ISO8859 conversion on the fly on the client side. I made the patch on the client side because at the same time I needed to make a hack to get the subtitles to work (to erase the subtitle area page_time_out).  See: http://forum.loggytronic.com/index.php?topic=503.0 (http://forum.loggytronic.com/index.php?topic=503.0)

But that subtitle patch, even it is working is not very well coded and should not be applied to git repo without some serious tiding up...!
Title: Re: UTF-8 hack for Vomp client
Post by: MartenR on June 02, 2012, 08:15:18
Chis, thanks for applying the patch.
Now the protocoll of the server in git is compatible to old 0.3.1 and the experimental raspberry branch.
Altough the raspberry branch can not do anything  useful at the moment.

Marten
Title: Re: UTF-8 hack for Vomp client
Post by: odin4242 on June 02, 2012, 18:21:08
Thanks guys, we'll use that server for the upcoming easyvdr 1.0
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on September 26, 2012, 20:47:30
I finally managed update my server to the "git" version to test the Raspberry PI client. Meanwhile I noticed that the server side UTF8 patch is not working for "Timers" menu. Could you fix that Marten, when you have time for it...
Title: Re: UTF-8 hack for Vomp client
Post by: MartenR on September 26, 2012, 23:20:21
Well, I am currently away from my vdr. But looking in the code, it seems like the problem is coming from the filename of the recording.
Which has to stay untouched from the conversion routine, this can only be solved by a major change in protocoll.
Anyway I will soon convert the raspberry gui to utf-8, then at least for them the problem will go away on UTF-8 systems.

Marten
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on September 27, 2012, 06:14:39
Ok, Now I remember it. That was the reason I did finally decide to make my UTF8 hack on the client side. I guess it could be resolved on the server side by the server sending in addition to a file name a "printable file name" field to a client... That of course requires changes to client code too.
Title: Re: UTF-8 hack for Vomp client
Post by: MartenR on September 28, 2012, 07:09:21
Yes, that is the way to do it. But I think this should wait until a new release is closer on all platforms in order to not cause too much hassle for the tester in the current development branches.

Marten
Title: Re: UTF-8 hack for Vomp client
Post by: hondansx on December 11, 2012, 19:54:43
What is the right way now that all german umlauts are shown right on the rasperry?

1. vdr env should be utf-8?
2. l10n/main-de should be utf-8?
3. rasp-vompclient env should be utf-8?

Any hints would be great, because on rasp-client side all umlauts are broken for me.
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on December 11, 2012, 23:05:03
1) VDR env (and then also VDR fonts) should be UTF8. This will effect timers, file names and epg information. If you did use the ISO fonts before you should manually change the fonts of your recordings and the epg data of recordings to UTF 8 and delete your old timers file at:

/var/lib/vdr/timers.conf

You can convert vdr file names (recording names) to UTF8 by running the following command in the recordings directory:

convmv --notest -r -f latin1 -t utf-8 .

You can convert the epg-information of recordings (the vdr.info file contents) to UTF8 by running the following command in the recordings directory:

for i in `find . -name info.vdr` ; do cp -a $i $i.pre-utf8 && iconv -f latin1 -t utf-8 $i.pre-utf8 > $i && rm $i.pre-utf8 ; done

2)  l10n/main-de of the vompserver plugin should be in UTF8. Currently you have to do this manually. This will effect the German translations of VOMP menus, etc.

cp main-de main-de-iso ; iconv -f iso-8859-1 -t utf-8 <main-de-iso >main-de

3) This is to make the raspi vomp client fonts to UTF8.

Can you precise if the umlauts are broken in menu texts (case 2 above) or in epg information & recordings (case 3 above)?
Title: Re: UTF-8 hack for Vomp client
Post by: MartenR on December 12, 2012, 07:14:50
Quote2)  l10n/main-de of the vompserver plugin should be in UTF8. Currently you have to do this manually. This will effect the German translations of VOMP menus, etc.
Are you sure? The l10n files in git are definitely in UTF8. May be some setting in the git configuration is wrong.

The second thing is, you should not need to switch to the vdr to UTF8 (but I recommend it). vomp should in this case use the native charset and convert it to UTF 8 on the server side.
If this is not the case, we should debug it.

Marten
Title: Re: UTF-8 hack for Vomp client
Post by: JTe on December 12, 2012, 08:41:31
Ok, I must have been building and installing only the server binary and not a full package with l10 files (so I must have the old l10 files installed).

Yes  you are right in not needing to change the VDR to UTF8 to run the vomp, but at least with the version 1.7.27 VDR menus with umlauts (on VDR side, not vomp) did not work with the ISO-fonts with the skins I was using (so nothing to do with vomp, more like with the vdr itself). Because of this  I have never tried to run the VDR server & vomp with ISO fonts, but I assume it works (anybody tested this?)


Title: Re: UTF-8 hack for Vomp client
Post by: hondansx on December 12, 2012, 20:10:28
Hey Guys thanks for the input.

I will give a try
Title: Re: UTF-8 hack for Vomp client
Post by: hondansx on December 16, 2012, 16:31:13
I have updated the l10n Directory and now the menu umlauts are okay on my rasperry (and on my mvp too)
So I can leave my vdr in iso.;-)