https://bugs.documentfoundation.org/show_bug.cgi?id=149882

--- Comment #9 from Mike Kaganski <mikekagan...@hotmail.com> ---
(In reply to Alexander from comment #8)

Thanks! Indeed, it has the problem in 7.3, and is fixed in 7.4. By the way,
LibreOffice now works better in that regards than MS Office: the latter will
destroy the macros on any non-Greek locale - e.g., on my Russian locale it
shows opened the macro this way:

> Option Explicit
> 
> Public Function GreekToLatin(celltxt As Variant) As String
>     Dim i As Long, j As Long
>     
>     Dim txt As Variant
>     
>     txt = Application.WorksheetFunction.Trim(celltxt)
>     
>     If Len(txt) Then
>         'МефбфспрЮ уе режЬ
>         txt = LCase(txt)
> 
>         'БнфйкбфЬуфбуз т ме у
>         txt = Replace(txt, "т", "у")
> 
>         'БнфйкбфЬуфбуз 'пх' уе 'oy' ==> (9)
>         txt = Replace(txt, "ьх", "oy")
>         txt = Replace(txt, "ьы", "oy")
>         txt = Replace(txt, "пы", "oy")
> 
>         'БцбЯсеуз фьнщн клр
>         Dim MeTonous As Variant, Atona As Variant
>         MeTonous = Array("Ь", "Э", "Ю", "Я", "ь", "э", "ю", "ъ", "ы", "А", 
> "а")
>         Atona = Array("б", "е", "з", "й", "п", "х", "щ", "й", "х", "й", "х")
> 
>         For i = 0 To UBound(MeTonous)
>             txt = Replace(txt, MeTonous(i), Atona(i))
>         Next
> 
>         'БнфйкбфЬуфбуз дйциьггщн (бх, ех, зх) ме (av, ev, iv)==> (3)
>         Dim Difth As Variant, tov As Variant, tof As Variant
>         Difth = Array("бх", "ех", "зх")
>         tov = Array("в", "г", "д", "ж", "л", "м", "н", "с", _
>                     "б", "е", "з", "й", "п", "х", "щ")
> 
>         For i = 0 To UBound(Difth)
>             For j = 0 To UBound(tov)
>                 txt = Replace(txt, Difth(i) & tov(j), Left(Difth(i), 1) & "v" 
> & tov(j))
>             Next
>         Next
> 
>         'БнфйкбфЬуфбуз дйциьггщн (бх, ех, зх) ме (af, ef, if)==>(4)
>         tof = Array("и", "к", "о", "р", "у", "ф", "ц", "ч", "ш")
> 
>         For i = 0 To UBound(Difth)
>             For j = 0 To UBound(tof)
>                 txt = Replace(txt, Difth(i) & tof(j), Left(Difth(i), 1) & "f" 
> & tof(j))
>             Next
>         Next
>         'јфбн еЯнбй  фЭлпт фзт лЭозт ==> (4)
>         For i = 0 To UBound(Difth)
>             txt = Replace(txt & " ", Difth(i) & " ", Left(Difth(i), 1) & "f ")
>         Next
> 
>         'Фп 'мр' уфзн бсчЮ  гЯнефбй 'b' ==> (5)
>         txt = Replace(" " & txt, " мр", " b")
> 
>         'Фп 'мр' уфп фЭлпт  гЯнефбй 'b' ==>(7)
>         txt = Replace(txt & " ", "мр ", "b ")
> 
>         'БнфйкбфЬуфбуз ухмрлькщн
>         Dim SimplocaGr As Variant, SimplocaLn As Variant
>         SimplocaGr = Array("гг", "гч", "го", "пх")
>         SimplocaLn = Array("ng", "nch", "nx", "ou")
>         For i = 0 To UBound(SimplocaGr)
>             txt = Replace(txt, SimplocaGr(i), SimplocaLn(i))
>         Next
> 
>         'БнфйкбфЬуфбуз хрьрпйрщн чбсбкфЮсщн
>         Dim Greek As Variant, Latin As Variant
>         Greek = Array("б", "в", "г", "д", "е", "ж", "з", "и", "й", "к", _
>                       "л", "м", "н", "о", "п", "р", "с", "у", "ф", "х", _
>                       "ц", "ч", "ш", "щ")
>         Latin = Array("a", "v", "g", "d", "e", "z", "i", "th", "i", "k", _
>                       "l", "m", "n", "x", "o", "p", "r", "s", "t", "y", _
>                       "f", "ch", "ps", "o")
> 
>         For i = 0 To UBound(Greek)
>             txt = Replace(txt, Greek(i), Latin(i))
>         Next
> 
>         txt = Trim(txt)
>         'МефбфспрЮ рсюфпх чбсбкфЮсб уе кецблбЯп (Proper)
>         txt = Application.WorksheetFunction.Proper(txt)
>         GreekToLatin = txt
>     End If
> End Function

i.e., it simply treats the stored Windows-1253 encoding as Windows-1251. In
LibreOffice, which uses Unicode also for macros, it will import, show and
export the macros correctly (with a caveat that, since MS formats use
non-Unicode encoding, if you use some character not representable in the
original macro encoding, it will still convert to ? - so you can't have both
Greek and Cyrillic characters in one MS VBA macro).

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to