Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

National Language Support (NLS) Usage in Ifort

$
0
0

For a project I was experimenting with a 'text' file which is Unicode (UTF-16(LE)). The test file has a few strings in it with a mixture of 'normal' ASCII characters and with some Arabic characters. I read the file as a buffer array of 2 byte integers, ignoring the first 4 bytes which are a Unicode header Z'FFFE', I can find LF and CR Z'0D00' and Z'0A00' that denote the string boundaries. I can then hit the NLS function MBConvertUnicodeToMB' to convert to double byte character set text strings. So far so good, however the Normal character all come in just fine and the Arabic characters all come back as question marks. Not so surprising perhaps as if I call NLSGetLocale my language is English and my codepage is 1252 (I think 1256 would be the correct codepage for Arabic).

If I call NLSSetLocale ('Arabic','Egypt' ) for example I get an OK return status, but then if I call NLSGetLocale nothing has changed I still get English, united kingdom and codepage 1252. If I set codepage 1256 NLSsetlocale crashes. I think perhaps it is because the locale I asked for is not installed so I have being playing with NLSEnumLocales which should give me a list of options installed and available. However, I get access violations using this call I think because I am doing it incorrectly.

A three line code snippet in the help showing declaration and usage of NLSEnumLocales would be most helpful could anyone oblige?

The help topics around NLS are rather sparse and could do with a bit of improvement and searching the forums there appears to be virtually no topics on this subject, is it not much used?

Thanks in advance

Andrew 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>