0

I tried to concatenate the strings but none of below things works for me in Arabic language and it works fine for all other languages.

  1. Approach

    String fileName = getCurrentDate() + UNDERSCORE
        + getFileNameFromSubject(emailTO.getSubject()) + "."
        + emailDefinition.getEmailMessageFileType();
    
  2. Approach

    StringBuilder fileName=new StringBuilder();
    fileName.append(getCurrentDate()).append(UNDERSCORE)
        .append(getFileNameFromSubject(emailTO.getSubject())).append(".")
        .append(emailDefinition.getEmailMessageFileType());
    
  3. Approach

    String fileName=String.format("%s_%s.%s", getCurrentDate(),"subject",".msg");
    

Do we need to use any specific API to make it work for all languages including RTL languages?

Holger
  • 285,553
  • 42
  • 434
  • 765
  • 1
    I think you have to reverse concatenation order for Araibic. – Oleg Cherednik Nov 28 '18 at 05:17
  • Could you please add an example output? As expected – Jonathan JOhx Nov 28 '18 at 05:20
  • See this link https://stackoverflow.com/questions/6177294/string-concatenation-containing-arabic-and-western-characters – Chetan Joshi Nov 28 '18 at 05:27
  • You should provide a better problem description than “it does not work”. Further, when the code does not work, why do you tag the question with `[performance]`? – Holger Nov 28 '18 at 08:08
  • It creating text like this img src onerroralerthello hello.msg_20181128-113423-170 +0530 due to this file format type icon is showing incorrect .i e .msg extension changed here – Ramesh Bathini Nov 28 '18 at 09:57
  • This is hard to believe, as the definition of what is the extension of a file name string does not depend on the user language. Neither does the string concatenation. Even if a name might get rendered differently with RTL content, no file manager should consider the file type to be different. You should provide a [mcve] capable of reproducing the issue… – Holger Nov 28 '18 at 10:43

0 Answers0