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)
Hi, I have a accentuated letter (ö) in a script for an Installer. It's a file name. This is not working and I'm told to try using the octal value for the extended ascii character. Does anyone no how to do this? If I had the word "filförval", can I just put in the value between the letters, like... (9 Replies)
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)
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)
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)
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... (3 Replies)
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)
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)
Hi All,
I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting?
Thanks in Advance (2 Replies)
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
LEARN ABOUT DEBIAN
io::async::protocol::stream
IO::Async::Protocol::Stream(3pm) User Contributed Perl Documentation IO::Async::Protocol::Stream(3pm)NAME
"IO::Async::Protocol::Stream" - base class for stream-based protocols
SYNOPSIS
Most likely this class will be subclassed to implement a particular network protocol.
package Net::Async::HelloWorld;
use strict;
use warnings;
use base qw( IO::Async::Protocol::Stream );
sub on_read
{
my $self = shift;
my ( $buffref, $eof ) = @_;
return 0 unless $$buffref =~ s/^(.*)
//;
my $line = $1;
if( $line =~ m/^HELLO (.*)/ ) {
my $name = $1;
$self->invoke_event( on_hello => $name );
}
return 1;
}
sub send_hello
{
my $self = shift;
my ( $name ) = @_;
$self->write( "HELLO $name
" );
}
This small example elides such details as error handling, which a real protocol implementation would be likely to contain.
DESCRIPTION
This subclass of IO::Async::Protocol is intended to stand as a base class for implementing stream-based protocols. It provides an interface
similar to IO::Async::Stream, primarily, a "write" method and an "on_read" event handler.
It contains an instance of an "IO::Async::Stream" object which it uses for actual communication, rather than being a subclass of it,
allowing a level of independence from the actual stream being used. For example, the stream may actually be an IO::Async::SSLStream to
allow the protocol to be used over SSL.
As with "IO::Async::Stream", it is required that by the time the protocol object is added to a Loop, that it either has an "on_read"
method, or has been configured with an "on_read" callback handler.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters:
$ret = on_read $buffer, $eof
The "on_read" handler is invoked identically to "IO::Async::Stream".
on_closed
The "on_closed" handler is optional, but if provided, will be invoked after the stream is closed by either side (either because the
"close()" method has been invoked on it, or on an incoming EOF).
PARAMETERS
The following named parameters may be passed to "new" or "configure":
on_read => CODE
CODE reference for the "on_read" event.
handle => IO
A shortcut for the common case where the transport only needs to be a plain "IO::Async::Stream" object. If this argument is
provided without a "transport" object, a new "IO::Async::Stream" object will be built around the given IO handle, and used as the
transport.
METHODS
$protocol->write( $data )
Writes the given data by calling the "write" method on the contained transport stream.
$protocol->connect( %args )
Sets up a connection to a peer, and configures the underlying "transport" for the Protocol. Calls "IO::Async::Protocol" "connect" with
"socktype" set to "stream".
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Protocol::Stream(3pm)