|
Revision 406, 282 bytes
(checked in by astrange, 2 years ago)
|
Use the (LGPL) Mozilla automatic charset detection library for external subtitles.
Unfortunately, it's quite large...
References #87
|
| Line | |
|---|
| 1 |
#!/usr/bin/perl |
|---|
| 2 |
|
|---|
| 3 |
use strict; |
|---|
| 4 |
|
|---|
| 5 |
my %charsets; |
|---|
| 6 |
|
|---|
| 7 |
for(@ARGV) |
|---|
| 8 |
{ |
|---|
| 9 |
open FILE,$_ or die; |
|---|
| 10 |
$_=do {local $/; <FILE>}; |
|---|
| 11 |
|
|---|
| 12 |
# $charsets{$1}=1 while(/SequenceModel.*?=.*?\{[^}"]+"([^"]*)"[^}]+\}/gs); |
|---|
| 13 |
$charsets{$1}=1 while(/"([A-Za-z0-9_\-]+)"/g); |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
print join "\n",sort keys %charsets; |
|---|
| 17 |
print "\n"; |
|---|