Importing Japanese text

I’ve got a C API application that I use toimport text into a Notes database. I’ve got

some text in charset ISO-2022-JP (Japanese)

that I want to convert to LMBCS. My thought

was to call NLS_load_charset (charset

NSL_CIS_JIS) then call MultiByteToWideChar to

get it into Unicode, then call NLS_Translate.

Does this sound workable? When I tried it,

the application crashed on the NLS_load_charset

call. It’s a very simple API so I can’t see

how I could mess it up. Any ideas?

Subject: Importing Japanese text

ideas how to mess it up? Use a wrong declaration, for example:Declare Function NLS_load_charset(CSID As Integer, ppInfo As Long) As Integer

not guaranteed, but you will probably crash the Notes.

BTW are you calling API right from the script? Better declaration would be:

Declare Function W32_NLS_load_charset Lib “nnotes” Alias “NLS_load_charset” (ByVal CSID As Integer, ppInfo As Long) As Integer

IMO, in case you use OS API like MultiByteToWideChar to convert source to Unicode, you do not need to load Japanese charset, but Unicode. You can also then use (instead of NLS_xxx functions) OSTranslate (after you convert source to Unicode).

In case you load the appropriate Japanese charset you should specify NLS_translate parameter as “platform native”. At least that’s how I understand this issue. I did not use these functions much, so please let us know how you finally managed to get it work (when you’ll manage it:-).

Good luck

Normunds

http://www.ls2capi.com