Sponsored Content
Top Forums Programming How to read extended ASCII characters from stdin? Post 302931970 by sanzee007 on Saturday 17th of January 2015 12:42:02 PM
Old 01-17-2015
How to read extended ASCII characters from stdin?

Hi,
I want to read extended ASCII characters from keyboard using c language on unix/linux. How to read extended characters from keyboard or by copy-paste in terminal irrespective of locale set in the system. I want to read the input characters from keyboard, store it in an array or some local variable and calculate exactly how many bytes of data read. Using wchar_t and it's library functions is not helping correctly.

Can anyone please give sample C code to process such request?

Thanks for your valuable replies.
Sanzee

Last edited by sanzee007; 01-17-2015 at 01:43 PM.. Reason: Typo error
 

10 More Discussions You Might Find Interesting

1. Programming

Extended ascii

Hi all, I would like to change the extended ascii code ( 128 - 255). I tried to change LC_ALL and LANG in current session ( values from locale -a) and for no good. Thanks. (0 Replies)
Discussion started by: avis
0 Replies

2. Shell Programming and Scripting

extended ascii problem

hi i would like to check text files if they contain extended ascii characters within or not. i really dont have any idea how to start your kind help would be very much appreciated thanks. (7 Replies)
Discussion started by: smooth
7 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. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

5. AIX

Printing extended ASCII

Hi All, I'm trying to send extended ascii characters to my HP2055 as part of PCL printer control codes. What I want to do is select a bar code font, print the bar code and reset the printer to the default font. Selecting the bar code font works good. Printing the bar code goes almost ok too. ... (5 Replies)
Discussion started by: petervg
5 Replies

6. Shell Programming and Scripting

Identify extended ascii characters in a file

Hi, Is there a way to identify the lines in a file having extended ascii characters and display the same? For instance I have a file abc.txt having below data aaa|bbb|111|This is first line aaa|bbb|222|This is secõnd line aaa|bbb|333|This is third line aaa|bbb|444|This is foùrth line... (3 Replies)
Discussion started by: decci_7
3 Replies

7. Shell Programming and Scripting

Search and Replace Extended Ascii Characters

We are getting extended Ascii characters in the input file and my requirement is to search and replace them with a space. I am using the following command LANG=C sed -e 's// /g' It is doing a good job, but in some cases it is replacing the extended characters with two spaces. So my input... (12 Replies)
Discussion started by: ysvsr1
12 Replies

8. Shell Programming and Scripting

Removal Extended ASCII using awk

Hi All, I am trying to remove (SELECTIVE - passed as argument) Extended ASCII using Awk based on adhoc basis. Can you please let me know how to do it. I have to implement this using awk only. Thanks & Regads (14 Replies)
Discussion started by: tostay2003
14 Replies

9. Shell Programming and Scripting

Extended ASCII Characters keep on getting reintroduced to text files

I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows. Before I start I set: export LC_ALL=C I clean it up by removing all non-English ASCII characters with the following command; grep -v $''... (4 Replies)
Discussion started by: lewk
4 Replies

10. UNIX for Beginners Questions & Answers

Print byte position of extended ascii character

Hello, I am on AIX. When I encounter extended ascii characters and special characters on a file I need to print.. Byte position, actual character and line number. Is there a simple command that can give me the above result ? Thanks in advance (38 Replies)
Discussion started by: rosebud123
38 Replies
hilkbd(7)						 Miscellaneous Information Manual						 hilkbd(7)

NAME
hilkbd - HP-HIL mapped keyboard driver DESCRIPTION
HP-HIL, the Hewlett-Packard Human Interface Link, is the Hewlett-Packard standard for interfacing a personal computer, terminal, or work- station to its input devices. supplies input from all mapped keyboards on a specified HP-HIL link. returns mapped keycodes, not ASCII characters. "Raw" keycodes are the individual key downstrokes and upstrokes, and are different for each type of keyboard. maps the raw input into the keycodes and protocol expected by the HP-UX, Pascal Workstation, and BASIC/UX operating sys- tems. The driver can usurp a keyboard from by changing it from mapped mode to raw mode. System Calls gives exclusive access to the keyboard. If there is an ITE (internal terminal emulator) associated with the keyboard, the ITE loses input from the keyboard until the keyboard device is closed. Any previous queued input for the keyboard device is flushed from the input queue. returns control of the keyboard to the ITE, if present. Any unread input is discarded at that time. returns data from the keyboard in time-stamped packets: time_stamp, when repacked into an integer data type of four or more bytes, specifies the time since an arbitrary point in the past (for example, system start-up time). This point does not change between packets, but time during a power failure may or may not be counted. The time is in units of tens of milliseconds. The status byte encodes the state of the keyboard and keys: 0x8X shift and control 0x9X control only 0xAX shift only 0xBX no shift or control The data byte contains the actual keystroke. If the file status flag O_NDELAY is set, returns instead of blocking, when no data is available. The system call on an HP-HIL keyboard is considered "slow"; that is, it can be interrupted by caught signals (see signal(2)). is not supported by can be used to poll for input to read from devices. for write or for exceptional conditions always returns a false indication in the bit masks. is used to perform special operations on the device. system calls have the form: The following request codes are defined in Read the configuration code. This request returns a one-byte configuration code in the variable to which arg points. This contains a field, defined by which specifies the keyboard identification code. The possible values of this field are defined in the header file, and this identification code affects interpretation of the language code. All other fields in the configuration code are cur- rently undefined. Read the language code. This request returns a one-byte language code, as read from the keyboard, in the variable to which arg points. If there is more than one keyboard, the language is taken from the first keyboard on the link. Interpretation of the language code is affected by the keyboard identification field within the configuration code. Read the keyboard status register. This request returns a one-byte value containing bit flags specifying the state of the shift and control keys in the vari- able to which arg points: KBD_STAT_LEFTSHIFT The left shift key is up KBD_STAT_RIGHTSHIFT The right shift key is up KBD_STAT_SHIFT Both shift keys are up KBD_STAT_CTRL The control key is up Other bits are undefined. Set the keyboard auto-repeat rate. The one-byte value to which arg points is the negative of the repeat period, in tens of milliseconds. The repeat rate is the reciprocal of the repeat period. A parameter of zero disables auto-repeat. Set the keyboard auto-repeat delay. The one-byte value to which arg points is the negative of the repeat delay, in tens of milliseconds. Cause an audible beep. The one-byte value to which arg points specifies the volume of the beep, within the range through Implementations with fewer than discrete levels of volume will scale the parameter into the smaller range. ERRORS
An invalid parameter was detected by A signal was caught during a system call. No keyboard is present on the HP-HIL link specified by the minor number. An attempt was made to use using The device is already open. AUTHOR
was developed by the Hewlett-Packard Company. FILES
/dev/hilkbd* SEE ALSO
mknod(1M), select(2), signal(2), hil(7), termio(7). hilkbd(7)
All times are GMT -4. The time now is 01:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy