Sponsored Content
Full Discussion: Ascii value of character?
Top Forums UNIX for Dummies Questions & Answers Ascii value of character? Post 302234572 by Ygor on Wednesday 10th of September 2008 12:54:06 AM
Old 09-10-2008
Interesting. From info printf...
Quote:
* If the leading character of a numeric argument is `"' or `'' then
its value is the numeric value of the immediately following
character. Any remaining characters are silently ignored if the
`POSIXLY_CORRECT' environment variable is set; otherwise, a
warning is printed. For example, `printf "%d" "'a"' outputs `97'
on hosts that use the ASCII character set, since `a' has the
numeric value 97 in ASCII.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ASCII character to accept logon password

Hey all, Just found your forum...Looks super rich with info! Can't wait to get through it all. I am currently writing a web app in .net that telnets into a unix server (require uid + passwd), runs a command, and returns that output to be displayed on the web page. I have gotten through the... (8 Replies)
Discussion started by: gord
8 Replies

2. UNIX for Dummies Questions & Answers

Non-ascii character detection (perl or grep)

Hi, Can I know how to grep for lines with non-ascii characters in a file? If not grep, at least can we do it with command-line perl or awk? I tried the functionality of perl, but still could not get the result. Any help?? PS: I was sure that someone should have asked this question... (9 Replies)
Discussion started by: srinivasan_85
9 Replies

3. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

4. UNIX for Dummies Questions & Answers

global search and replacement of a non-ascii character

Hi, I need to do a global search and replacement of a non-ascii character. Let me first give the background of my problem. Very frequently, I need to copy set of references from different sources. Typically, a reference would like this: Banumathy et al., 2002 G. Banumathy, V. Singh and U.... (1 Reply)
Discussion started by: effjay
1 Replies

5. UNIX for Advanced & Expert Users

ASCII Character Set

I thought I would point this out. This has a lot of the non printing characters. ASCII Character Set (7 Replies)
Discussion started by: cokedude
7 Replies

6. UNIX for Dummies Questions & Answers

How to grep for a non-standard ASCII character?

A very simple question but I have scoured the web and can't find an answer. How do I search for a character by ASCII code in a regular expression using grep? For example, we use the End of Medium symbol as a delimiter in certain files. (this is ascii 031 in oct, displays as ^Y) I want to grep... (6 Replies)
Discussion started by: DJR
6 Replies

7. Shell Programming and Scripting

FTP Issue with Non ascii character

I have one file .dat file on windows server containg the following text "Bürki" Now When I am using FTP (get) command from UNIX server the text is appering is as "Bürki" I want to preserve the text in the file on UNIX server as it is in source file. Could you please suggest some... (2 Replies)
Discussion started by: Bhushan D
2 Replies

8. Shell Programming and Scripting

Print the next ASCII character

Hi, In my file, for few field I have to print the next ASCII character for every character. In the below file, I have to do for the 2,3 and 5th fields. Input File ======== 1|abc|def|5|ghi 2|jkl|mno|6|pqr Expected Ouput file ======= 1|bcd|efg|5|hij 2|klm|nop|6|qrs (2 Replies)
Discussion started by: machomaddy
2 Replies

9. Shell Programming and Scripting

Remove some special ascii character

Hello I have this special caracter after retreving rows from sql server: "....spasses: • Entrem al valort 6050108002811 • El donem..." I would like a sed command to remove it..or just know it's ascii code in order to replace it into my sql sentence.. Hope some one knows how to do that.... (7 Replies)
Discussion started by: ldiaz2106
7 Replies

10. UNIX for Dummies Questions & Answers

What is ASCII character?

Hi Guru, I have put one post yesterday and get answer. thanks for your help. my question today is: what is ascii character for following non printable characters: ( we need filter these characters out in another process) ^MM-^E^MM-^E. Old post link: ... (5 Replies)
Discussion started by: ken002
5 Replies
MBLEN(3)						     Linux Programmer's Manual							  MBLEN(3)

NAME
mblen - determine number of bytes in next multibyte character SYNOPSIS
#include <stdlib.h> int mblen(const char *s, size_t n); DESCRIPTION
If s is not a NULL pointer, the mblen() function inspects at most n bytes of the multibyte string starting at s and extracts the next com- plete multibyte character. It uses a static anonymous shift state only known to the mblen() function. If the multibyte character is not the null wide character, it returns the number of bytes that were consumed from s. If the multibyte character is the null wide character, it returns 0. If the n bytes starting at s do not contain a complete multibyte character, mblen() returns -1. This can happen even if n is greater than or equal to MB_CUR_MAX, if the multibyte string contains redundant shift sequences. If the multibyte string starting at s contains an invalid multibyte sequence before the next complete character, mblen() also returns -1. If s is a NULL pointer, the mblen() function resets the shift state, only known to this function, to the initial state, and returns nonzero if the encoding has nontrivial shift state, or zero if the encoding is stateless. RETURN VALUE
The mblen() function returns the number of bytes parsed from the multibyte sequence starting at s, if a non-null wide character was recog- nized. It returns 0, if a null wide character was recognized. It returns -1, if an invalid multibyte sequence was encountered or if it couldn't parse a complete multibyte character. CONFORMING TO
C99. NOTES
The behavior of mblen() depends on the LC_CTYPE category of the current locale. The function mbrlen(3) provides a better interface to the same functionality. SEE ALSO
mbrlen(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
1999-07-25 MBLEN(3)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy