encoding

Any good security encoding libraries for .NET out there ?

Hi all.. Been reading up on various injection-type attacks, and it seems like the best way to get rid of these vulnurabilities is to encode all user input to remove / replace some characters with others (< > ; etc). What's my best bet here? Are there any nice libraries out there to aid me with this? Or something that could help me spot...

In HTML I can make a checkmark with &#x2713; . Is there a corresponding X-mark?

No text :) ...

php: file_get_contents encoding problem (SOLVED)

SOLVED by changing the encoding in header() function to KOI8-R header('Content-Type: text/plain; charset=KOI8-R'); My task is simple: make a post request to translate.google.com and get the translation. In the following example I'm using the word "hello" to translate into russian. header('Content-Type: text/plain; charset=utf-8'); ...

UTF-8 and Servlets on Tomcat/Linux

I've had some problems with reading and writing UTF-8 from servlets on Tomcat 6 / Linux. request and response were utf-8, browser was utf-8, URIEncoding was set in server.xml on both connectors and hosts. Ins short, every known thing for me in code itself, and server configuration was utf-8. When reading request, I've had to take byte ...

Overcome Encoding Problems with PHP, SoapServer, UTF-8, and non English Characters?

I'm having problems getting PHP to play nicely with SoapServer + UTF-8. Anytime anyone sends a Soap Request with non english characters (i.e. funny quotes, accented characters, etc) the SoapServer throws an exception saying "Bad Request." I've tried decoding the request with utf8_decode and even HTML Special Characters encoded the text. ...

How do you handle different character encodings?

I'm trying to understand the basics of practical programming around character encodings. A few things to consider: I know how to read a file whose encoding is different, and convert it to the console's encoding. But when I try to convert literal strings that appear in source code, for some reason, it doesn't always work: In IntelliJ'...

Export MS Access Memo field and convert Unicode

I have an Access 2003 database. A table has a Memo field and I'm having issues with getting that data out. Exporting that field to a txt or csv chops that field off (255 characters) Exporting as Excel gives me strange characters for linebreaks Appending to a mysql database via myODBC gives an error about "incorrect string" Using VBA w...

Encoding a number, C# implementation of z-base-32 or something else?

I need to encode/decode an integer which is up to 9 digits long but most often 7 digits long. I'd like to make it easier to communicate/memorise - it will be communicated by phone, copied & pasted, keyed in from a card/memory/label, hand-written on labels and generally abused! I'm looking to reduce the number of digits (whilst adding a ...

Windows Media Format SDK based encoder drops frame rate and will not recover

I have an application that runs 24/7 encoding video from a capture card. It goes into an encoder build against the Windows Media Format SDK. Under some circumstances (maybe a CPU spike?) the encoder will decide to drop to about 1/4 of the frame rate and never seems to recover. It just gets stuck at the lower frame rate until it is res...

Converting text file from ANSI to ASCII using C#

I have an ANSI-encoded file, and I want to convert the lines I read from the file to ASCII. How do I go about doing this in C#? EDIT: What if i used BinaryReader BinaryReader reader = new BinaryReader(input, Encoding.Default); but this reader takes (Stream, Encoding) but "Stream" is an abstract!! and where should i put the path of t...

.NET: Why isn't base 64 in Encoding.GetEncodings()?

I have a function that can decode an array of bytes into a string of characters using a specified encoding. Example: Function Decode(ByVal bytes() As Byte, ByVal codePage As String) As String Dim enc As Text.Encoding = Text.Encoding.GetEncoding(codePage) Return enc.GetString(bytes) End Function If I want to include base64 in ...

Do you think character encoding is table-looking up?

For all the chararacter encodings that I have seen, they all have a code table, each code point corresponding to a character that should be represented/drawed. It seems to fall into the MVC pattern. The wierd character are caused because the programs are looking up the wrong table for the given code points. If so, it will be no matter ...

MySQL encoding issue

For some reason, my mysql table is converting single and double quotes into strange characters. E.g "aha" is changed into: “aha” How can I fix this, or detect this in PHP and decode everything?? ...

Problem reading accented characters in PHP

Got a strange problem in PHP land. Here's a stripped down example: $handle = fopen("file.txt", "r"); while (($line = fgets($handle)) !== FALSE) { echo $line; } fclose($handle); As an example, if I have a file that looks like this: Lucien Frégis Then the above code run from the command line outputs the same n...

How can I use lame to encode wav files within a shell script?

I'm trying to set artist information via variables with spaces in them. Lame craps out. Maybe I'm being retarded with bash? #!/bin/bash year=2008; artist="New Kids On The Block"; album="The Block"; bitrate=320; lame="lame -b $bitrate --ta \"$artist\" --tl \"$album\" --ty $year" function first_half { for (( i=1;i<10;i++ )); do ...

How do I sanitize user input for proper content-encoding before I save it?

I've got an application where users input text into forms. The data is saved into a MySQL database (collation: utf8_general_ci) and then output as XML (encoding: UTF-8). The problem is that people tend to cut and paste their information from other sources, for instance, Microsoft Word documents or PDFs for instance. This input text of...

How do you change the filename extension stored in a string in c++?

Alright here's the deal, I'm taking an intro to c++ class at my university and am having trouble figuring out how to change the extension of a file. First, what we are suppose to do is read in a .txt file and count words, sentences, vowels etc. Well I got this but the next step is what's troubling me. We are then suppose to create a new ...

Quotation marks turn to question marks ...

So I have a ruby script that parses HTML pages and saves the extracted string into a DB... but i'm getting weired charcters (usually question marks) instead of plain text... Eg : ‘SOME TEXT’ instead of 'Some Text' I've tried HTML entities and CGI::unescape ... but to no avail... did some googling n set $KCODE = 'u' & require 'jcode...

How does trellis coded modulation (TCM) work?

I'm having a hard time understanding TCM. I've been trying to decipher this explanation, but I'm not having much luck. I'm not looking for lots of detail, just the basics of TCM encoding and decoding. A simple example of encoding and decoding a short string would great! Thanks! ...

Human friendly binary encoding

Some time ago I came across a website that described a binary-to-text encoding which was human friendly. For example on input (for decoding) it accepted 0, o and O all as the same value, because people tend to mix those characters very easy. Unfortunately I can't remember how it was called... Edit: this was the one I was looking for: ...