ascii

Objective-C ASCII to plain text

I am trying to get the ASCII numbers I load from a file to convert into plain text. I've looked at NSASCIIStringEncoding, but when I run it it just returns what I inputted. Here's the code I'm using: NSData *asciiData = [[myWords objectAtIndex:d] dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *test = [[NSS...

String.getBytes("ISO-8859-1") gives me 16-bit characters on OS X

Using Java 6 to get 8-bit characters from a String: System.out.println(Arrays.toString("öä".getBytes("ISO-8859-1"))); gives me, on Linux: [-10, 28] but OS X I get: [63, 63, 63, -89] I seem get the same result when using the fancy new nio CharSetEncoder class. What am I doing wrong? Or is it Apple's fault? :) ...

Finding and removing non ascii characters from an Oracle Varchar2

We are currently migrating one of our oracle databases to UTF8 and we have found a few records that are near the 4000 byte varchar limit. When we try and migrate these record they fail as they contain characters that become multibyte UF8 characters. What I want to do within PL/SQL is locate these characters to see what they are and then...

How do I extract ASCII data from binary file with unknown format, in Windows?

On Windows, what is the best way to convert a binary file where the internal structure is unknown less that its contents are ASCII in nature back to plain text? Ideally the conversion would produce a "human"-readable version. I think the file should contain something like the following: Date: 10 FEB 2010 House: 345 Dogwood Drive Exter...

How do I properly work with unicode characters in python to keep from getting errors?

I'm working on a python plugin for Google Quick Search Box, and it's doing some odd things with non-ascii characters. It seems like the code works fine up until I try constructing a string containing the non-ascii characters (ü has been my test character). I am using the following code snippet for the construction, with new_task as the v...

XSL: Include some ASCII chars when method="text"

I've got an XSL template that outputs text as opposed to XML. In this text, I need to include ASCII character 0x10 in certain position. I understand this character is not allowed in an XML document, but I'm going to output text, so why am I not allowed to use it anyway? I also understand it will not be possible to put this character li...

Separating ASCII text from binary content in a file

I have a file that has both ASCII text and binary content. I would like to extract the text without having to parse the binary content as the binary content is 180MB. Can I simply extract the text for further manipulation ... what would be the best way of going about it. The ASCII is at the very beginning of the file. ...

How to write a program that receives an ASCII code and display its character?

I'm new with Java and just learning... but how would you write a program that receives an ASCII code and displays its character. For example, if the user enters 97,the program displays character a. ...

Replacing HTML ascii codes via a bash script?

Hello again! I need a way to replace HTML ascii codes like ! with their correct character in bash. Is there a utility I could run my output through to do this, or something along those lines? Thanks! ...

Converting from ascii to utf-8 with Python

Hello. I have xmpp bot written in python. One of it's plugins is able to execute OS commands and send output to the user. As far as I know output should be unicode-like to send it over xmpp protocol. So I tried to handle it this way: output = os.popen(cmd).read() if not isinstance(output, unicode): output = unicode(output,'utf-8'...

Showing asian unicode string in UILabel

Hi, How can we show asian unicode values in UILabel \U2013\U00ee\U2013\U00e6\U2013\U2202\U2013\U220f\U2013\U03c0 \U2013\U00ee\U2013\U220f\U2013\U03c0\U2013\U00aa\U2013\U221e\U2014\U00c5 Thanks ...

C++ Beginner's question on input/output text files.?

If I have an input text with the only thing written of "A" and I want a series of code that will allow me to generate the next ASCII set (B), how would I do so? #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } #include iostream> #include fstream> #include iomanip> #include string> using namespace std; int ...

TUI using slang with pure ascii (7 bit) characters via termcap

I am using newt/snack (a TUI graphical Widgit library for Python based on slang) to have some interactive scripts. However for some target terminals the output of those screens are not very nice. I can change the look of them by changing the $TERM variable to remove non printable characters, and to convert them to something more suitable...

model.__unicode__() returning russian string cause TemplateSyntaxError

code: class Gallery(models.Model): title = models.CharField(max_length=100) description = models.TextField(blank=True) created = models.DateField(auto_now_add=True) class Meta: verbose_name = 'галерея' verbose_name_plural = 'галереи' def __unicode__(self): return 'Галерея %s' % self.title ...

How to convert an ASCII string to an UTF8 string in C++?

How to convert an ASCII std::string to an UTF8 (Unicode) std::string in C++? ...

Unpacking EBCDIC Packed Decimals (COMP-3) in an ASCII Conversion

I am using Jon Skeet's EBCDIC implementation in .NET to read a VSAM file downloaded in binary mode with FTP from a mainframe system. It works very well for reading/writing in this encoding, but it does not have anything to read packed-decimal values. My file contains these, and I need to unpack them (at the cost of more bytes, obviousl...

Python: Convert Unicode to ASCII without errors

html = urllib.urlopen(link).read() html.encode("utf8","ignore") self.response.out.write(html) Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 507, in __call__ ha...

Create Tab Delimited ASCII file in Rails

I need to create a tab delimited ASCII file from a table (Hits) in my DB. I can already export this table into a CSV file. What's the best way to go about doing this? Is there a way to easily create this in rails? ...

c++: getting ascii value of a wide char

Hi all! let's say i have a char array like "äa". is there a way to get the ascii value (e.g 228) of the first char, which is a multibyte? even if i cast my array to a wchar_t * array, i'm not able to get the ascii value of "ä", because its 2 bytes long. is there a way to do this, im trying for 2 days now :( i'm using gcc. thanks! ...

Convert two ascii characters to their 'corresponding' one character extended ascii representation

The problem: I have two fixed width strings from an external system. The first contains the base characters (like a-z), the second (MAY) contain diacritics to be appended to the first string to create the actual characters. string asciibase = "Dutch has funny chars: a,e,u"; string diacrits = " ' \" \""; //no clue...