ascii

does .net provides api to convert ascii to bcd?

Platfrom 3.5 .net.(c#) please refer me to code which converts ascii to bcd (c#). ...

Simple caesar cipher in java

Hey I'm making a simple caesar cipher in Java using the formula [x-> (x+shift-1) mod 127 + 1] I want to have my encrypted text to have the ASCII characters except the control characters(i.e from 32-127). How can I avoid the control characters from 0-31 applying in the encrypted text. Thank you. ...

Using PHP to Convert ASCII Character to Decimal Equivalent

Can someone suggest a (preferably) graceful way to convert an ASCII character to its decimal equivalent using PHP? ...

c# ascii protocol problem

i have a program that send ASCII commands to a device via a serial port. The program is a demo and doesn't do what i want. I am just trying to get the device to respond in c# and I'm not getting anything back. all the serial port settings are correct. I am sending exactly the same message as the demo software. //e.g message <STX>ABC<EO...

ASCII Encoding and Umlauts and Accents

Hello, I have a requiremnt to produce text files with ASCII encoding. I have a database full of Greek, French, and German characters with Umlauts and Accents. Is this even possible? string reportString = report.makeReport(); Dictionary<string, string> replaceCharacters = new Dictionary<string, string>(); byte[] encodedReport = Encodi...

Convert Hi-Ansi chars to Ascii equivalent (é -> e) in Delphi(2007)

Is there a routine available in D2007 to convert the characters in the high range of the ANSI table (>127) to their equivalent ones in pure ASCII (<=127) according to a locale (codepage)? I know some chars cannot translate well but most can, esp. in the 192-255 range: À -> A à -> a Ë -> E ë -> e Ç -> C ç -> c – -> - (that can be trickier...

Encoding utf-8 to base64 with accents

Hi, I have some data like this: data1 = ['Agos', '30490349304'] data2 = ['Desir\xc3\xa9','9839483948'] I'm using an API that expects the data encoded in base64, so what I do is: data = data1 string = base64.b64encode("Hi, %s! Your code is %s" % (data[0], data[0])) myXMLRPCCall(string) Which works fine with data1. With data2 the enc...

Will [a-z] ever match accented characters in PREG/PCRE?

I'm already aware that \w in PCRE (particularly PHP's implementation) can sometimes match some non-ASCII characters depending on the locale of the system, but what about [a-z]? I wouldn't think so, but I noticed these lines in one of Drupal's core files (includes/theme.inc, simplified): // To avoid illegal characters in the class, // w...

How do you print a smiley-face in assembly?

I wrote a program in assembler and compiled it. It is meant to print a blue smiley face and then wait for the user to press a key before it terminates. It does do that last bit but it doesn't print the smiley face. Can someone explain what have I done wrong ? CSEG segment org 100h Begin: mov ax,0B800h mov es,ax mov di,0 mov ah,31 mov ...

Bash: Convert non-ASCII characters to ASCII

How can I convert a string like Žvaigždės aukštybėj užges or äüöÖÜÄ to Zvaigzdes aukstybej uzges or auoOUA, respectively, using Bash? Basically I just want to convert all characters which aren't in the Latin alphabet. Thanks ...

How do I use a Save Dialog Box in C# to save an ASCII text file?

Okay, I'm probably missing something really simple here, but I've been at this for over an hour now and getting nowhere. :( I have a C# project using Microsoft's Visual C# 2008 Express Edition. The Save dialog box appears as desired, but it never makes the file. Practially speaking, once the file is specified, I'd like the application...

Parse HEX ASCII into numbers?

I have a H/W device that normally uses a serial port for an interface, sending and receiving binary messages to a PC UI program. I've added an Ethernet port and small TCP/IP stack with a small web server that I want to use to replace the serial port UI with a web browser UI. The messages are mostly request/response sort of things, but f...

Convert double-byte numbers and spaces in filenames to ASCII

Given a directory of filenames consisting of double-byte/full-width numbers and spaces (along with some half-width numbers and underscores), how can I convert all of the numbers and spaces to single-byte characters? For example, this filename consists of a double-byte number, followed by a double-byte space, followed by some single-byte...

How to handle ascii control characters in sql server?

How can we handle ascii characters using sql server 2005? Which data type can I use to store ascii characters, mainly control characters? For example: I have a file with strings delimited by some control characters like backspace. I need to read this file into my sql server tables. I want to know what data type (char,nchar,varchar, .....

Credit Card validation: can Card Name contain non-ASCII characters?

Can the Card Name (i.e. the cardholder name, not the card type) contain non-ASCII characters? Example: "JOSÉ GONZÁLEZ". ...

C#: How to assign a Character using ASCII data?

In C#: How do I store an ASCII character to a "char" literal? The ASCII character I want to use for my special character is the File Separator symbol: Decimal: 028 Octal: 034 Hex: 01C Binary: 00011100 // This works in C/C++, but not C#: static const char FS = 0x1C; // File Separator ...

Given a unicode error I don't understand.

Here is my code, I'm sure it looks terrible but it all works as it should, only problem I'm having is with the last line... import pyPdf import os import csv class UnicodeWriter: """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. """ def __init__(self, f, dialect=csv.exc...

javascript - how to convert unicode string to ascii

I need to convert unicode string to ascii to make a nice string for friendly url. Dont's ask me why dont do this in server side, please. ...

how do i regex search for weird non-ascii characters in python?

I'm using the following regex basically to search for and delete these characters. invalid_unicode = re.compile(ur'(Û|²|°|±|É|¹|Í)') My source code in ascii encoded, and whenever I try to run the script it spits out: SyntaxError: Non-ASCII character '\xdb' in file ./release.py on line 273, but no encoding declared; see http://www.pyt...

C# ASCII or Unicode

hi im a beginner in programming and network development. i have a question regarding ASCII and Unicode encoding. in msdn and other web examples do the following: byte[] byteData = Encoding.ASCII.GetBytes(data); is this because these code samples are old? shouldn't it be: byte[] byteData = Encoding.Unicode.GetBytes(data); thanks fo...