ansi

Best way for Parsing ANSI and UTF-16LE files using Python 2/3?

I have a collection of files encoded in ANSI or UTF-16LE. I would like python to open the files using the correct encoding. The problem is that the ANSI files do not raise any sort of exception when encoded using UTF-16le and vice versa. Is there a straightforward way to open up the files using the correct file encoding? ...

ANSI color support using Groovy on Windows XP

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color w...

problems using the -ansi switch in MinGW 3.4.5

I was reading about the flags used in gcc, and read a reccommendation to use gcc -ansi -pedantic -Wall file1 [file2 [file3...]] -o output. For the quality of my code's sake, to keep it standard, and get all the warnings about it. Well, about compiling with -ansi... If I include <stdlib.h>, gcc gives me this error: In file included from...

Oracle - NULLS in foreign keys?

Hi, I'm trying to answer the following question... "Explain the issues that arise when NULLs are present in columns that make up foreign keys. Discuss how ANSI have attempted to resolve this issue with the three 'matching rules' that can be adopted when using concatenated foreign keys." Can anyone point me in the right direction as to...

How to load ANSI escape codes or get coloured file listing in WinXP cmd shell ?

This is related to this question : How to get coloured file listing in windows cmd shell ? I'm trying to get, wouldn't you believe it, coloured file listing in windows cmd shell. Windows are XP SP2, if that matters. In the old DOS days there used to be little programs like hdir, adir and such which displayed that nice. Nowadays, such pr...

Dictionary Component or source code that can check in multiple languges

We are developing an application in which we need to implement spell checking for Indic languages that use ANSI fonts (not UNICODE) I am looking for a Dictionary Component or Source Code that will allow: To maintain separate dictionaries like for example Legal, commercial, etc. Support more than one language If possible to allow devel...

Allocate data through a function (ANSI C)

Hi all, I d love to know how I can allocate data through a function, and after the function is returned the data is still allocated. This is both for basic types (int, char**) and user defined types. Below are two snipsets of code. Both have the allocation within the function though after the return the allocation goes. int* nCheck = N...

Paste contents to TextBox in ANSI Format

How can I make the textbox contents to ANSI format when paste in C#? ...

Returning the terminal cursor to start-of-line with wrapping enabled

I'm writing a filter (in a pipe destined for a terminal output) that sometimes needs to "overwrite" a line that has just occurred. It works by passing stdin to stdout character-by-character until a \n is reached, and then invoking special behaviour. My problem regards how to return to the beginning of the line. The first thing I thoug...

Com wrapper and code pages

I have a legacy Delphi COM library that accepts an ANSI string (code page 1252) as parameter. The generated .net wrapper accepts a string for this parameter. Passing in a regular string however doesn't end well. If passed in the '°' character a question mark takes up it's spot. How can I go and debug this? Is it the com wrapper not reco...

How to hide ANSI colour escape codes from fmt

I use (GNU) fmt to format longer texts with nice (‘optimal’) line breaks. However, if the text contains any ANSI colour escape sequences (which are never displayed, and only serve to colour the text when displaying it), fmt considers these as normal characters, and calculates the wrong line lengths. I’m not sure how good literal escape ...

Shell Prompt Line Wrapping Issue

I've done something to break my Bash Shell Prompt in OS X (10.5.7) Terminal. This is the PS1 that I had configured: PS1='\[\e[1;32m\]\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ ' As far as I can tell I have the color commands escaping correctly. However when I scroll up and down in my command history I often get line wrapping issues if the...

Oracle Left outer join

SELECT a, last_note_user, c, d, iso_src FROM X CROSS JOIN Y CROSS JOIN Z LEFT OUTER JOIN W ON W.last_note_user = Z.userid AND W.user_ten = Y.iso_src The above ANSI code fetch me 107 records,When I giving the same query without ANSI code it is fetching 875 records.The non ANSI quer...

whitespace UNION bug

This one got me the other day. What would you expect the following to return? SELECT 'X' AS line UNION SELECT 'X ' AS line Notice the space in the second SELECT. Well apparently SQL 2000 and 2005 both return 1 result. Even though its a UNION (and not a UNION ALL). There is nothing I can see in Books on line about this. Why does it ha...

Why on earth would anyone use strncpy instead of strcpy?

Edit: I've added the source for the example. I came across this example: char source[MAX] = "123456789"; char source1[MAX] = "123456789"; char destination[MAX] = "abcdefg"; char destination1[MAX] = "abcdefg"; char *return_string; int index = 5; /* This is how strcpy works */ printf("destination is originally = '%s'\n", destination); r...

256 color terminal library for Ruby?

Is there a gem like 'Term::ANSIColor' which works with 256 color terminals? The perl script 256colors2.pl works great in my terminal, and I'd like to use some of these colors in my ruby scripts without manually inserting the ANSI codes. ...

How to get colored emails from crontab?

I call a Python script from crontab. The script does generates colored output using ANSI escapes but when crontab is sending the mail with the output I see the escapes instead of colors. What is happening is logic but I would like to know if it would be possible to generate a html message instead. I would like a solution that does no...

How to read an ANSI encoded file containing special characters

Hello folk, I'm writing a TFS Checkin policy, which checks if our source files containing our file header. My problem is, that our file header contains a special character "©" and unfortunately some of our source files are encoded in ANSI. So if I read these files in the policy, the string looks like this "Copyright � 2009". string co...

Convert ANSI characters to UTF-8 in Java

Is there a way to convert an ANSI string to UTF using Java. I have a custom serializer that uses readUTF & writeUTF methods of the DataInputStream class to deserialize and serialze string. If i receive a string encoded in ANSI and is too long, ~100000 chars long i get the error; Caused by: java.io.UTFDataFormatException: encode...

Nested data in a database table

I have a table which contains records which are related in the following way: parent, child, grandchild. I would like to be able to run queries to do the following: retrieve all records that are descended from a particular record retrieve all records that are direct children of a particular record (i.e. only direct children) retrieve...