ascii

Benefit of using API over protocol for application extension / plugin

The application I am working on supports importing data defined in different ASCII formats. I want to allow users to define their own ASCII based file formats which the application can import. I am considering two different approaches: API. Make a script API e.g. Lua, Python or JavaScript which allows constructing data. Importer will ...

ASCII in Windows XP and Ubuntu Linux

I've made a program in MVSC++ which outputs memory contents (in ASCII). The ASCII I see in windows console seem to match what I see in various ASCII tables (smiley, diamond, club, right arrow etc). This program needs to compile under Linux (which is does), but the ASCII output looks completely different. A few symbols are the same but th...

Read unicode text files with java

Real simple question really. I need to read a Unicode text file in a Java program. I am used to using plain ASCII text with a BufferedReader FileReader combo which is obviously not working :( I know that I can read a String in the 'traditional' way using a Buffered Reader and then convert it using something like: temp = new String(tem...

ICertRequest2::Submit CSR data Compatability ASCII to BSTR

Hello Experts, I have my certrequest as a PEM base64 data. See data below. 1) My understanding is that this is an ASCII data type and not in UNICODE format. Please clarify. -----BEGIN NEW CERTIFICATE REQUEST----- MIIBTjCBuAIBADARMQ8wDQYDVQQDEwZ3dTAwMzEwgZ0wDQYJKoZIhvcNAQEBBQAD gYsAMIGHAoGBAKP48eljetv3fVicT6g6hKjmLpsySJaZ/NnepEJEqtQQNbw...

How do I get the length (i.e. number of characters) of an ASCII string in VB.NET?

I'm using this code to return some string from a tcpclient but when the string comes back it has a leading " character in it. I'm trying to remove it but the Len() function is reading the number of bytes instead of the string itself. How can I alter this to give me the length of the string as I would normally use it and not of the arra...

Capitalizing non-ASCII words in Python

How to capitalize words containing non-ASCII characters in Python? Is there a way to tune string's capitalize() method to do that? ...

Making an index-creating class in C++

Hello everyone, I'm busy with programming a class that creates an index out of a text-file ASCII/BINARY. My problem is that I don't really know how to start. I already had some tries but none really worked well for me. I do NOT need to find the address of the file via the MFT. Just loading the file and finding stuff much faster by searc...

EOF marker when generating text files?

When I'm generating a text file programatically, should I insert the ASCII EOF marker (decimal value 26) at the end of the file? Do the .NET Programming Languages do this automatically? ...

Working with foreign symbols in python

I'm parsing a JSON feed in Python and it contains this character, causing it not to validate. Is there a way to handle these symbols? Can they be converted or is they're a tidy way to remove them? I don't even know what this symbol is called or what causes them, otherwise I would research it myself. EDIT: Stackover Flow is strippin...

Is there any logic behind ASCII codes' ordering ?

Hi, I was teaching C to my younger brother studying engineering. I was explaining him how different data-types are actually stored in the memory. I explained him the logistics behind having signed/unsigned numbers and floating point bit in decimal numbers. While I was telling him about char type in C, I also took him through the ASCII c...

Adding non printable chars to a string in Java?

I need to add some non printable chars to a string in java so it can be sent down a tcp pipe. the chars mean something to the protocol I am using (record separator and end of message respectively) what is the best way to go about doing this? Ideally I'l like to refer to them as constants so that I can use string concatonation/stringbui...

Smart ASCII string representation

I have an app that converts binary file into ASCII file. With profiler I found that I spend 25% of time doing Encoding.GetBytes() which is called from BinaryWriter.Write(wchar[]). It is completely correct since I have many constructs similar to this one: m_writer.Write("some fancy long text".ToCharArray()); Do you have any smart idea...

PHP: How to remove all non printable characters in a string?

I imagine I need to remove chars 0-31 and 127, Is there a function or piece of code to do this efficiently. ...

How to implement C# enum for enumerated char(1) database field?

OK, so I have a database field of type char(1) that has a small number of possible state codes (e.g. 'F'= Failure, 'U'=Unknown, etc.). I'd like to have a C# enum class that corresponds to these states. I can do: public enum StatusCode : byte { Unknown = (byte) 'U', Failure = (byte) 'F', // etc. } So far so good. But in ...

Hex to Ascii? Java

Hi. I'm looking for a way to convert hex to ascii in Java. An example: byte temps[] = new byte[4]; temps[0] = 0x74; temps[1] = 0x65; temps[2] = 0x73; temps[3] = 0x74; String foo = ..(temps); System.out.print(foo); That should ou...

C# read unicode?

Hi. I am receiving a unicode message via the network, which looks like: 74 00 65 00 73 00 74 00 3F 00 I am using a BinaryReader to read the stream from my socket, but the problem is that it doesn't offer a "ReadWideString" function, or something similar to it. Anyone an idea how to deal with this? Thanks! ...

Convert html entities to ascii in Python

I need to convert any html entity into its ASCII equivalent using Python. My use case is that I am cleaning up some HTML used to build emails to create plaintext emails from the HTML. Right now, I only really know how to create unicode from these entities when I need ASCII (I think) so that the plaintext email reads correctly with thin...

Intelligent UTF-8 to UTF-7 in .NET

If I have a string of UTF-8 characters and they need to be output to an older system as UTF-7 I have two questions pertaining to this. How can I convert a string s which has UTF-8 characters to the same string without those characters efficiently? Are there any simple of converting extended characters like 'Ō' to their closest non exte...

GetModuleFileNameEx - Is it possible to get the path in char* and NOT in TCHAR[]?

Here is my code: TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>"); GetModuleFileNameEx (hProcess, NULL, szProcessName, sizeof(szProcessName)/sizeof(TCHAR)); I need the path in char*, and not in TCHAR[]. Is it somehow possible without converting (WideCharToMultiByte)? Thanks... ...

PHP ASCII Table Library

Is threr a de-facto standard library for creating ASCII "tables" in PHP? Basically, I want some PHP code that, when handed an Array or other data structure will output tables that look something like the mysql command line client's results +--------+---------------------+----------------------------------+ | fld_id | fld_name ...