03-30-2011
Quote:
I am comparing two multibyte characters in two different platforms having different LC_CTYPE variables, they are returning different values.
Yes, that is quite possible. What mechanism are you using to compare them? Are you trying to see if they map to the same glyph or codepoint?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to split a string, either using awk or cut or basic unix commands (no programming) , with a multibyte charectar as a delimeter.
Ex:
abcd-efgh-ijkl
split by -efgh- to get two segments abcd & ijkl
Is it possible?
Thanks
A.H.S (1 Reply)
Discussion started by: azmathshaikh
1 Replies
2. Shell Programming and Scripting
Hello,
Is there any UNIX utility/command/executable that will convert mutlibyte characters to standard single byte ASCII characters in a given file?
and
Is there any UNIX utility/command/executable that will recognize multibyte characters in a given file name?
The typical multibyte... (8 Replies)
Discussion started by: jerardfjay
8 Replies
3. Shell Programming and Scripting
Hi! I'm trying to separate text into sentences, like this:
$pattern = "/(|]|,)**/";
preg_match_all($pattern, $text, $matches);
This works fine unless the text contains multibyte characters, like "åäö". How can I make this work with these exotic characters? (2 Replies)
Discussion started by: Ilja
2 Replies
4. Shell Programming and Scripting
Hi! I'm trying to separate text into sentences, like this:
$pattern = "/(|]|,)**/";
preg_match_all($pattern, $text, $matches);
This works fine unless the text contains multibyte characters, like "åäö". How can I make this work with these exotic characters?
An example phrase that doesn't match:... (1 Reply)
Discussion started by: Ilja
1 Replies
5. Shell Programming and Scripting
Hi,
I have one doubt over sftp.
I am trnasferring a file from server1 to server2 using sftp.
The size of the file shows different in file 1 and file2 after sftp even though it shows same number of byte transferred. I don't understand the problem.
For example:
I have file1 having size... (3 Replies)
Discussion started by: siba.s.nayak
3 Replies
6. Programming
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies
7. Shell Programming and Scripting
Hello all
Can anyone help me to solve the below issue
I want to take user input with space separated .The number of inputs can be variable
like if user inputs
1 2 3 4
ouput will stored in as array a where i=4 and I can retreive the value like a =3
any thoughts how to do it
... (2 Replies)
Discussion started by: Pratik4891
2 Replies
8. Shell Programming and Scripting
Hello,
I have two directories - prev and current . They both have same multiple subdirectories and files. Now the current directory can have some updated files and some new files added that is not in prev. I want to find the list of file names that differ. I am doing this because i can not... (2 Replies)
Discussion started by: jakSun8
2 Replies
9. Shell Programming and Scripting
I am using Solaris8, userA's shell '/usr/ace/prog/sdshell', AppuserB's shell '/bin/ksh'.
serverT:/home/userA>LC_CTYPE=iso_8859_1; export LC_CTYPE; vtemp='userA variable'; export vtemp
serverT:/home/userA>echo "LC_CTYPE=$LC_CTYPE, vtemp=$vtemp";
LC_CTYPE=iso_8859_1, vtemp=userA... (4 Replies)
Discussion started by: kchinnam
4 Replies
10. Shell Programming and Scripting
Hi
I have a requirement to insert a dot "." after a position in each line, say 110th position.
For which, I have written the below command.
cat filename | sed 's/./&\./110' > new_filename
The code is working fine, but when we have multi byte (2 or 3) characters in the input file, the... (3 Replies)
Discussion started by: tostay2003
3 Replies
LEARN ABOUT REDHAT
wctomb
WCTOMB(3) Linux Programmer's Manual WCTOMB(3)
NAME
wctomb - convert a wide character to a multibyte sequence
SYNOPSIS
#include <stdlib.h>
int wctomb(char *s, wchar_t wc);
DESCRIPTION
If s is not NULL, the wctomb function converts the wide character wc to its multibyte representation and stores it at the beginning of the
character array pointed to by s. It updates the shift state, which is stored in a static anonymous variable only known to the wctomb func-
tion, and returns the length of said multibyte representation, i.e. the number of bytes written at s.
The programmer must ensure that there is room for at least MB_CUR_MAX bytes at s.
If s is NULL, the wctomb function resets the shift state, only known to this function, to the initial state, and returns non-zero if the
encoding has non-trivial shift state, or zero if the encoding is stateless.
RETURN VALUE
If s is not NULL, the wctomb function returns the number of bytes that have been written to the byte array at s. If wc can not be repre-
sented as a multibyte sequence (according to the current locale), -1 is returned.
If s is NULL, the wctomb function returns non-zero if the encoding has non-trivial shift state, or zero if the encoding is stateless.
CONFORMING TO
ISO/ANSI C, UNIX98
SEE ALSO
wcrtomb(3), wcstombs(3), MB_CUR_MAX(3)
NOTES
The behaviour of wctomb depends on the LC_CTYPE category of the current locale.
This function is not multi-thread safe. The function wcrtomb provides a better interface to the same functionality.
GNU
1999-07-25 WCTOMB(3)