Free Support Forum - aspose.com

Support for Russian Culture Name: en-RU (Java)

We cannot create a PST file. The error received is
“com.aspose.email.system.exceptions.ArgumentException: Culture Name: en-RU is not a supported culture”
at com.aspose.email.internal.k.b.c(Unknown Source)
at com.aspose.email.internal.k.b.<init>(Unknown Source)
at com.aspose.email.internal.k.b.a(Unknown Source)
at com.aspose.email.internal.af.f.f(Unknown Source)
at com.aspose.email.internal.k.b.d(Unknown Source)
at com.aspose.email.internal.b.an.h(Unknown Source)
at com.aspose.email.akg$b.b(SourceFile:831)
at com.aspose.email.akg$b.a(SourceFile:867)
at com.aspose.email.akg.a(SourceFile:487)
at com.aspose.email.akg.c(SourceFile:206)
at com.aspose.email.ape.s(SourceFile:2792)
at com.aspose.email.ape.<init>(SourceFile:142)
at com.aspose.email.PersonalStorage.a(SourceFile:388)
at com.aspose.email.PersonalStorage.create(SourceFile:346)

Apparently, there are no english speakers in Russia? Can you please fix this problem ASAP because it affects our Russian customer base.

Thank you!
Jamie

@jamie-1,

I have observed the stack trace shared by you and require sample PST reproducing issue along with working sample code as It will help us investigate the issue quickly and assist you further. Please also share the environment details with us like computer language settings and Timezone information.

region.jpg (58.0 KB)
russian_keyboard.JPG (766.5 KB)
russiankeyboard.jpg (22.3 KB)
uskeyboard.jpg (21.1 KB)

Russian keyboard’s support both English and Russian (it works this way with many other languages too). You switch between English and Russian on Mac OSX using Cmd+space. Presumably, when Aspose is obtaining the Language, it is getting the primary system language, which is English, this combined with the region of Russia, results in an invalid culture name.

This problem occurs irrespective of the PST file being opened. It also occurs when creating a new PST file. It seems to happen early on during Aspose initialization. I have reported this issue before, but there has been no progress. It is a serious issue in the Aspose Email product as it affects many regions/languages through out the world. We need a resolution ASAP.

I don’t believe incorporating source code is necessary, since, the issue occurs on PersonalStorage.create(…) before any data is added to the file.

When Aspose gets a list of supported languages by the OS, it should see both English and Russian. Currently, it only appears to be seeing English since it uses a culture name of en-RU, and then throws an error.

The language Russian should be defaulted when the OS locale is set to Russia. Although, Aspose should also support processing of an English PST files on such systems. Aspose ideally should work with PST files encoded in multiple different languages on the same system.

When our application is setup for the first time, it gets the default system language and locale from the OS. In the setup GUI of our app, there is the option for the user to override these language/locale settings with their specific preferences. If it is not possible for Aspose to detect the locale/language of the PST file and apply appropriate decoding, then it would be nice if we could at least supply language/locale information when opening/creating a PST file.

@jamie-1,

Thank you for sharing the details with us. An issue with ID EMAILJAVA-34522 has been created in our issue tracking system to further investigate the requirements on our end. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

@jamie-1.

We have implemented new helper class CurrentThreadSettings. Auxiliary class that allows to define default Locale for current thread.

Methods :
Returns default Locale for current thread.

public static Locale getLocale()

Sets default Locale for current thread.

public static void setLocale(Locale locale)
public static void setLocale(String localeName)

We can use CurrentThreadSettings.setLocale in case of unrecognized default locale
and set most appropriate locale for Aspose Email lib

Code sample:

Locale defaultLocale = Locale.getDefault();
try {
    // set incorrect default Locale
    Locale.setDefault(new Locale("en", "RU"));
    // set Current Thread Locale for Aspose Email lib
    CurrentThreadSettings.setLocale("en-US");
    // or
    //CurrentThreadSettings.setLocale(new Locale("en", "US"));

    PersonalStorage.create("test.pst", FileFormatVersion.Unicode);
} finally {
    Locale.setDefault(defaultLocale);
}