Internationalization and localization tools


Culture-Sensitive C# Attribute

[DllImport("DLL name", CharSet = CharSet.Unicode)]

The following lists the named, optional parameters for DllImport:
   BestFitMapping
   CallingConvention
   CharSet
   EntryPoint
   ExactSpelling
   PreserveSig
   SetLastError
   ThrowOnUnmappableChar

Internationalization (I18n) Method Overview

The DllImport attribute provides the information needed to call a function exported from an unmanaged DLL. As a minimum requirement, you must supply the name of the DLL containing the entry point. You apply this attribute directly to C# method definitions.

For more information see Microsoft's MSDN online documentation.

I18n Issues

The default for the CharSet parameter is ANSI, which causes character corruption if Unicode text not matching the current system code page is passed to the imported dll. So CharSet should be explicitly specified.

Instead of this:
   [DllImport("shell32")]

Should specify CharSet:
   [DllImport("shell32", CharSet = CharSet.Unicode)]

C# Encoding Information

 

Lingoport internationalization and localization services and software