Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cyrilic to latinic
Message
From
23/10/2021 11:07:43
 
 
To
23/10/2021 09:43:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01682589
Message ID:
01682591
Views:
51
I need to do it through a program when read file with fopen() and fget() etc. In attachment is a sample file. Question is how to recognize (and convert) row 4 "Нови Београд" to "Novi Beograd"?



>Is there a way to recognize character in a file which is cyrilic (ascii code or other way) and convert it to appropriate latinic character (for example ц инто c, л инто l, п into p, ћ into ć ...). VFP 6 doesn't recognize unicode and my database is latinic.

You can build your own strings for a good chrtran, just need to set your editor's font into 1250 when you do it for latinica, and to 1251 when you do ćirilica. And then a strtran() for converting converting њ, љ, џ into nj, lj and dž also uppercase. There may be some snafu when the first word in a sentence begins with one of these, then they should convert into Nj, Lj and Dž, otherwise into NJ, LJ and DŽ for uppercased words. That's about the only thing complicated about it.

Here, you copy this while your codepage is set to ćirilica
lcCyr="абвгдђежзијклмнопрстћуфхцчшАБВГДЂЕЖЗИЈКЛМНОПРСТЋУФХЦЧШ"
Then set your codepage to latinica and copy this
lcLat="abvgdđežzijklmnoprstćufhcčšABVGDĐEŽZIJKLMNOPRSTĆUFHCČŠ"

Note that these don't contain the characters for lj, nj and dž, these must be done separately. About the case of đ being represented as dj, it is entirely wrong, there are so many cases when dj is not đ, see at http://ndragan.com/langsr/djilidj.html
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform