ascii

Is there an easy way to convert a number to hexidecimal ASCII chars in C?

I am working a C firmware program for an embedded device. I want to send an array of hex char values over the serial port. Is there a simple way to convert a value to ASCII hex? For example if the array contains 0xFF, I want to send out the ASCII string "FF", or for a hex value of 0x3B I want to send out "3B". How is this typically do...

Ruby 1.9 - invalid multibyte char (US-ASCII)

Im trying to make my rails application (2.3.5) to run on Ruby 1.9, I've this function that make some transformations on a string: def replace_special_chars(downcase = true) if downcase string = self.downcase else string = self end string.gsub! /á|ã|à|ä|â/, 'a' string.gsub! /é|è|ë|ê/, 'e' string.gsub! /í|ì|ï|î/, 'i' string.gsub! /ó|...

How to strip out invalid UTF-8 characters in Ruby 1.9

I just upgraded from Ruby 1.8 to 1.9, and most of my text processing scripts now fail with the error invalid byte sequence in UTF-8. I need to either strip out the invalid characters or specify that Ruby should use ASCII encoding instead (or whatever encoding the C stdio functions write, which is how the files were produced) -- how would...

Converting to ASCII in C

Using a microcontroller (PIC18F4580), I need to collect data and send it to an SD card for later analysis. The data it collects will have values between 0 and 1023, or 0x0 and 0x3FF. So what I need to do is convert 1023 into a base 10 string of literal ASCII values (0x31, 0x30, 0x32, 0x33, ...). My problem is that the only way I can th...

Replace non-ascii chars from a unicode string in Python

How can I replace non-ascii chars from a unicode string in Python? This are the output I spect for the given inputs: música -> musica cartón -> carton caño -> cano Myaybe with a dict where 'á' is a key and 'a' a value? ...

Converting Java String to ascii

I need to convert Strings that consists of some letters specific to certain languages (like HÄSTDJUR - note Ä) to a String without those special letters (in this case HASTDJUR). How can I do it in Java? Thanks for help! It is not really about how it sounds. The scenario is following - you want to use the application, but don't have th...

Convert ASCII characters to readable text

Hi! I've been struggling all day with trying to find classes that converts/decodes ASCII characters to readable text. I've found this method here at Stack Overflow, and it fixes many of the characters to readable text. But I'm still struggling with for example: &44; &46; &58; &39; ...and so forth. I'm receiving my data from a XML...

UTF-8 -> ASCII in C language

Hi guys. I have a simple question that I can't find anywhere over the internet, how can I convert UTF-8 to ASCII (mostly accented characters to the same character without accent) in C using only the standard lib? I found solutions to most of the languages out there, but not for C particularly. Thanks! EDIT: Some of the kind guys that c...

Help with Extended ASCII/Encoding in PHP!!

Good Evening folks. This is my code: static private function removeAccentedLetters($input){ for ($i = 0; $i < strlen($input); $i++) { $input[$i]=self::simplify($input[$i]); } return $input; } static private function simplify($in){ $ord=ord($in); switch ($ord) { case 193: //Á... return 'A'; ...

excel with Japanese(wide) fonts

I was working on parsing an excel file having japanese files in some of the cells. By using Spreadsheet::ParseExcel (Ver. 0.15) (which I know is older than current version) some of the cells with below characters <設定B-1コース> are appearing as in print Dumper $oWkc->{_Value}; $VAR1 = "\x{ff1c}\x{8a2d}\x{5b9a}B-\x{ff11}\x{30b3}\x{...

How to convert domain names with greek characters to an ascii URL?

For example: When typing παιχνιδια.com into Firefox, it is automatically converted to xn--kxadblxczv9d.com Please suggest a tool for making such a conversion. One of the easiest is this. Converts and checks for availability at the same time. ...

Binary Numbers. Error When Checking to be sure binary input is binary...

I'm writing a simple loop to make sure my input is a valid binary. Ex: I want to throw an error when any number higher than one is user input. I know I need to check against the ASCII numbers. What is going on here? I should not be getting an error when I input binary. Any thoughts? for (int i=0;i<size;i++) { printf("%i is string su...

Standard SQL - CHAR to ASCII

Using standard SQL, SQL-92, how can I convert a character to an ASCII value? In MySQL it's easy using the ascii() function, but SQL-92 doesn't have this. ...

How can I display Extended ASCII Codes characters in Perl?

How to display 192 character symbol ( └ ) in perl ? ...

Converter and compresser between ASCII and Binary

Hi I am trying to make a very easy converter/compressor; the program should take a file with 4 different types of ASCII characters and writ it out as binary to a file. The program should also read the binary file and convert it to ASCII and print it out on the screen. Under is my code, I can’t really get the char/cstring. What types of ...

excel: how do i break up cell contents into CODE

There is a code function that returns ASCII for every letter. I would like to use it in a way that it will break up a cell a1 = "some string" Into it's ASCII codes: Something like this: "23423423434634" Sorry I don't know the exact ASCII of that but you get my point. please note that i would like to do this specifically with a formu...

How to convert string to base64 ASCII Embedded in c

Possible Duplicate: How do I base64 encode (decode) in C? I am trying to convert an int into an ASCII byte array and then encode the byte array as a base64 string. I see a few posts on how to do this in C# and Java, but I want to do this in C. I'm doing this in windows, using MS Visual Studio. Is there a function provide...

How to convert a string of hex values to a string?

Say I have a string like: string hex = "48656c6c6f"; Where every two characters correspond to the hex representation of their ASCII, value, eg: 0x48 0x65 0x6c 0x6c 0x6f = "Hello" So how can I get "hello" from "48656c6c6f" without having to create a lookup ASCII table? atoi() obviously won't work here. ...

How do I display a Registered Trademark symbol (®) using VB.NET?

I have taken over support of an application at the company I work for. All of a sudden, the customer wants to be able to enter a registered trademark in a name field. The symbol, using ALT+0174, is being saved correctly, but the app is not encoding it properly. Essentially this is what I'm doing: Private Sub btnSave_Click(ByVal s...

Odd ASCII characters in NMEA 0813 data stream

Hello, i have been trying to read the NMEA data stream from my GPS receiver connected to a bluetooth module BlueNiceCom3 using various terminal programs (HTerm, MTTTY) but what i received was always like this: C O"i „ $GPGGA,0i „ 85649.99i „ 9,4900.1i „ 692,N,01i „ 205.7215i „ ,E,0,00,i „ 0.0,433.i „ 7,M,0.0,i „ M,,0000*i „ 67 $GPGi „ ...