Lets say you were sentenced by Dubai court for 20 years imprisonment. I am not expert in law but I think, one thing that comes first in your mind is to ask for clemency or pardon from court (which might mean admission of guilt). But that would not very easy. Here's one way out of the hole:
"In an unprecedented humanitarian gesture, His Highness Shaikh Mohammad Bin Rashid Al Maktoum, Vice-President and Prime Minister of the UAE and Ruler of Dubai, issued a decree stating that sentences of prisoners in Dubai jails be reduced for anyone who memorises the Quran or parts of it regardless of the severity or motive of the crime.
The decree listed the norms for reducing sentences. Inmates who memorise the entire Quran (30 parts) could get a reduction of 20 years.
— memorising 20 parts will help reduce 15 years.
— memorising 15 parts will help reduce 10 years.
— memorising 10 parts will help reduce five years of the term.
— memorising five parts will help reduce one year.
— memorising three parts will help reduce six months of the term.
Inmates on death row, or those who killed intentionally and those whose terms are less than six months cannot participate in this programme."
I assume one will have to memorize Quran in Arabic and that will be very difficult especially to those people who are don't speak Arabic at all.