Nice question. I'm not familiar with Arabic dates and I'm not sure whether Chrome is displaying the characters correctly. One possible method would be to convert the characters a list of to integers and then parse each element:
arabic2ints <- function(file) {
x <- readr::read_lines(file) # for UTF-8
lapply(x, function(xi) {
ints <- utf8ToInt(xi)
ints[ints >= 1632L & ints <= 1642L] - 1632L
})
}
arabic2ints("~/sandbox/aarabic.txt")
[[1]]
[1] 1 0
[[2]]
[1] 1 0 9 2 0 1 8 1 2 2 4 9
You can see 10
is easily deduced but I seem to have mangled the date. (The file aarabic.txt
contains your aarabic
object and the last line of your post as copied and pasted.)
If you like, you can provide a link to a .txt
file containing the dates in the form you need to convert, rather than relying on copying and pasting from a webpage. Also how are dates written in Arabic? (For example, is it mm-dd-yyyy
but with Arabic digits or is there anything else that's different?)