Skip to main content

Locale and Client Version

Locale and Client Version

Methods of the Intersys::PERLBIND default package provide access to Caché version information and Windows locale settings. Here is a complete listing of these methods:

get_client_version()
$clientver = Intersys::PERLBIND::get_client_version();

Identifies the version of Caché running on the Perl client machine.

setlocale()
$newlocale = Intersys::PERLBIND::setlocale($category, $locale)

Sets the default locale and returns a locale string for the new locale. For example:

   $newlocale = Intersys::PERLBIND::setlocale(0, "Russian") # 0 stands for LC_ALL

would set all locale categories to Russian and return the following string:

   Russian_Russia.1251

If the $locale argument is an empty string, the current default locale string will be returned. For example, given the following code:

   Intersys::PERLBIND::setlocale(0, "English")
   $mylocale = Intersys::PERLBIND::setlocale(0, ""),"\n";

the value of $mylocale would be:

   English_United States.1252

For detailed information, including a list of valid $category values, see the MSDN library entry for the setlocale() function in the Visual C++ runtime library.

set_thread_locale()
Intersys::PERLBIND::set_thread_locale($lcid)

Sets the locale id (LCID) for the calling thread. Applications that need to work with locales at runtime should call this method to ensure proper conversions. It is equivalent to calling setlocale() from the C++ runtime library inside the current thread, but a direct call to setlocale() may fail without throwing an exception in some cases.

For a listing of valid LCID values, see the "Locale ID (LCID) Chart" in the MSDN library (search on "LCID Chart").

For detailed information on locale settings, see the MSDN library entry for the SetThreadLocale() function, listed under "National Language Support".

FeedbackOpens in a new tab