conversion tools‎ > ‎

open office macro to convert CSX font to unicode

this is from tusita international IT team friend O.S.L:
Steps:
1. Open Ms Word file containing Pali character problem & delete page headers, footer. no. etc if exist. Save it.
2. Open again the file in Apache Open Office, run CSXtoUnicode macro* to replace problematic pali char
3. Save as odt format (Calibre not support Ms Word)
4. Use Calibre to convert to mobi format

* To use the macro in OO:
i. Select Tools>Macros>Organize Macros>Open Office.org Basic...
ii. Click 'Edit'
iii. copy paste macro codes in attached file to it.
iv. run it with the Pali file opened.

                                                                                                                                     
                                                                     
                                             
Sub CSXtoUnicode

oDoc = thisComponent

aFind = Array("  ", "ò", "ñ", "§", "â","à" ,"ä", "ã" ,"æ","å", "ô", "ó", "ÿ", "þ", "ì", "ë","î", "í", "ý", "ü", "ö", "õ", "¥", "¤", "ð", "ï", "è", "ç", "ê", "é", "ú", "ù", "ø", "÷")

aReplace = Array(" ", "Ṭ", "ṭ", "ṁ", "Ā", "ā", "Ī", "ī", "Ū", "ū", "Ḍ", "ḍ", "Ḥ", "ḥ", "Ḷ", "ḷ","Ḹ", "ḹ", "Ṃ", "ṃ", "Ṇ", "ṇ", "Ñ", "ñ", "Ṅ", "ṅ", "Ṛ", "ṛ", "Ṝ", "ṝ", "Ṣ", "ṣ", "Ś", "ś")

aRayCount = 0

FandR = oDoc.createReplaceDescriptor

FandR.SearchCaseSensitive = true

FandR.SearchRegularExpression = true

While aRayCount <= uBound(aFind)

 FandR.setSearchString(aFind(aRayCount))

 FandR.setReplaceString(aReplace(aRayCount))

 aRayCount = aRayCount + 1

 oDoc.ReplaceAll(FandR)

Wend

End Sub
Comments