Skip Menu |

This queue is for tickets about the Text-Morse CPAN distribution.

Report information
The Basics
Id: 101035
Status: resolved
Priority: 0/
Queue: Text-Morse

People
Owner: Nobody in particular
Requestors: svetoslav.chingov [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.04
Fixed in: 0.07



Subject: Support for Bulgarian and Russian. Transition to UTF8.
The attached patch provides support for Bularian and Russian language. It also transforms source code to UTF8.
Subject: Morse.pm.patch
--- Morse.pm 2014-12-20 10:46:20.557335000 +0200 +++ Morse.pm.BGRU 2014-12-20 18:28:05.165266000 +0200 @@ -2,8 +2,9 @@ use warnings; use strict; +use utf8; -$Text::Morse::VERSION = '0.04'; +$Text::Morse::VERSION = '0.06'; no warnings 'qw'; @@ -57,27 +58,89 @@ ); our %SWEDISH = (%ENGLISH, qw( -Å .--.- -Ä .-.- -Ö ---. -å .--.- -ä .-.- -ö ---. +Å .--.- +Ä .-.- +Ö ---. +Ã¥ .--.- +ä .-.- +ö ---. )); our %LATIN = (%ENGLISH, qw( -Á .--.- -Ä .-.- -Ö ---. -á .--.- -ä .-.- -ö ---. -É ..-.. -é ..-.. -Ñ --.-- -ñ --.-- -Ü ..-- -ü ..-- +Á .--.- +Ä .-.- +Ö ---. +á .--.- +ä .-.- +ö ---. +É ..-.. +é ..-.. +Ñ --.-- +ñ --.-- +Ü ..-- +ü ..-- +)); + +our %COMMON_CYR = qw( +А .- +Б -... +В .-- +Г --. +Д -.. +Е . +Ж ...- +З --.. +И .. +Й .--- +К -.- +Л .-.. +М -- +Н -. +О --- +П .--. +Р .-. +С ... +Т - +У ..- +Ф ..-. +Ð¥ .... +Ц -.-. +Ч ---. +Ш ---- +Щ --.- +Ю ..-- +Я .-.- +. .-.-.- +, --..-- +/ -...- +: ---... +' .----. +- -....- +? ..--.. +! ..--. +@ ...-.- ++ .-.-. +0 ----- +1 .---- +2 ..--- +3 ...-- +4 ....- +5 ..... +6 -.... +7 --... +8 ---.. +9 ----. +); + +our %BULGARIAN = (%COMMON_CYR, qw( +Ъ -..- +Ь -.-- +)); + +our %RUSSIAN = (%COMMON_CYR, qw( +Ь -..- +Ы -.-- +Э ..-.. )); sub new { @@ -87,6 +150,8 @@ my $hash = \%ENGLISH; $hash = \%SWEDISH if defined $lang and $lang =~ /^(SWEDISH|SVENSKA)$/i; $hash = \%LATIN if defined $lang and $lang =~ /^LATIN$/i; + $hash = \%BULGARIAN if defined $lang and $lang =~ /^(BULGARIAN|БЪЛГАРСКИ)$/i; + $hash = \%RUSSIAN if defined $lang and $lang =~ /^(RUSSIAN|РУССКИЙ)$/i; my $rev = {reverse %$hash}; my $self = {'enc' => $hash, 'dec' => $rev, 'lang' => $lang};
On Sat Dec 20 12:43:17 2014, svetoslav.chingov@gmail.com wrote: Show quoted text
> The attached patch provides support for Bularian and Russian language. > It also transforms source code to UTF8.
It seems the «use utf8;» pragma was missed when applying this, this is probably wrong (unless you're consistently working with octets, but no one really wants that). Leon
Thanks for the quick catch. Sloppy on my part. The module is being updated momentarily.
Here is a link to an (old) webpage about various international morse-codes: http://web.archive.org/web/20080430153850/http://homepages.cwi.nl/~dik/english/codes/morse.html And the wikipedia page for non-latin morse codes: https://en.wikipedia.org/wiki/Morse_code_for_non-Latin_alphabets
The patch listed here is included as of 0.07 I've taken the suggested links and have them in a TODO file now to be added soon. Thank you for all your help and suggestions.