Get subtitles from a mkv

1) With Mkvtoolnix, if there is a subtitle in a mkv, you can easily extact it, deselecting all the other tracks and then giving the command “start multiplexing”: it will save that track as a mks file.

2a) If that track is a text one, you can easily convert it in a srt with this command (with a subtitle editor you could have to do another, easy conversion from an ass format to a real srt format):
mkvextract tracks "your-mks-file.mks" 0:a-name-you-want.srt.

2b) It the track is an image one (i.g. with one .sup file or two .sub e .idx files) you should use some online tool, such as subtitlestools.com so that from two files, sub e idx, you can one file srt. It could be a long process, waiting for your time aftr other users. But that webpage should keep working even you go offline and the day after you come back to download your srt file.

Sometimes however the easiest way is to find your srt files online, i.g. with OpenSubtitles.

Google speech-to-text

If you use Google speech-to-text one problem is to type signs such as ‘(‘ or ‘)’. In English you can say (in a low voice) open bracket or close bracket. In Italian apri parentesi tonda o chiudi parentesi tonda: indeed saying only apri parentesi Google will type “apri parentesi” and not “( “.

w3c validation UTF-8 encoding error

With w3c validator you could get this error:
«Sorry, I am unable to validate this document because on line 3400 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.» 
That could be because you have some files included in the php file checked by w3c validator, like an .inc one, not encodeed as UTF-8.
To fix this oproblem you have to encode all the components of a php file as UTF-8.

batch change encoding to UTF-8 for several text (php) files

You can use recode
recode UTF-8 *.php -v

provided that all the files have the same encoding.
Otherwise you can try with something like
iconv -f US-ASCII -t UTF-8 *.php

a minor problem

It could be an apparent problem if there aren’t non-ascii characters in a file: then these files are yet recognized, with
file -i --mime-encoding *
as us-ascii.
So you can add a non ascii character, like è:
sed -i -e “$aè” *.php

and afterwards redo the command “recode” as above and replace some ascii expression, like agrave; with UFT-8 à character.
Eventually you will delete the “è” from the end of the files.

How to change encodig of “.srt” Subtitle File in UTF-8

To encode your SRT file in UTF-8 (for instance: “video.srt”), please follow this process:

1. Rename (F2) the “video.srt” file with your PC in “video.srt.txt”.
2. Launch a text app, like Kate.
3. Click on the “File” menu then select “Save the file as…”.
4. In coding option, select “UTF-8”. Then save your file.
5. Rename (F2) the file “video.srt.txt” to “video.srt”.
Done!

from: Zappiti Player 4K [EN]