Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I'm receiving messages from IBM MQSeries and processing them using C. I'm using a char buffer to store the msgs. But now, I'm receiving multi-byte characters in the msg. How to handle this? Cos I don't know the character set it belongs and moreover my program reads them as two disparate 1 byte characters.
Also,
How to set env variable LANG so that it remains same for the child processes.
Thanks in anticipation
Cheers,
K i s h o r e

Kishore! if you could be bit clear with the charsets (type of inputs) would br easier.
little what I can gather, here's it!
use headers
#include
#include
#include
and some routines for multi-byte characters within it...
Check out man pages:
mbtowc(3C), wctomb(3C), isdigit(3C)...about LANG setting
if using following shell: sh/bash/ksh
# LANG=english
# export LANG
if shell is: csh
# setenv LANG englishabove prefers to be before the start of program, if needed to be issued from the program itself and required for the child, then follow up:
#include
main(int argc, char *argv[], char *env[])
{ ...
// here *env[] will help you get the environ, NOT SET.
int ret=0;
char *var;
// generally basics..
ret=putenv("LANG=english");
var=getenv("LANG");
.
// CONFIGURE HERE **environ (global var)
.
// matter comes before the child process..
fork()...
}you can use the global object 'extern char **environ' in your program to add the environment variable, cause *env has the NULL pointer as the last character.
Routines: execl(),execv(),execvp(), and execlp(), place the pointer to the environ of calling process in the global object and is used to pass the environ of the calling process to the new process.
check man-pages: exec(2)if the above matter relates locale, LANG="C", then you can use the 'setlocale()' routine for initializing the LANG.
check man-pages: setlocale(3C)'ex: man -s3c setlocale'
for more informations you can check me
-aakash

![]() |
Doesn't recognize NIC
|
solaris installation prob...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |