Moish wrote:
Can #2 be used to set directionality of message display?
You mean text directionality (RTL/LTR)? I think not, with mb_detect_encoding() we can determine only charset, not the language. It could be done by searching in (converted to unicode) text for letters specific for RTL languages using regular expressions.