encoding

Umlaute are wrongly encoded!

I retrieve a stream. Everything works fine but the encoding of Umlaute (ä,ö,ü,ß). What is NäüßÖ´sas so viele Umlaute becomes NäüÃôsas so viele Umlaute I tried Ascii-Encoding and a few other ones as the following source shows. ASCIIEncoding encoder = new ASCIIEncoding(); Encoding enc = Encoding.GetEncoding(28591); stri...

Can't read Integer in Stream after encoding it as UTF-8 instead of ASCII

I had problems with Umlauts in ASCII so I encode my Stream as UTF-8 now, which works, but it brings up a problem. I normally read 4 Bytes before ARTIST to determine the length of ARTIST=WHOEVER using UTF8Encoding enc = new UTF8Encoding(); string response = enc.GetString(message, 0, bytesRead); int posArtist = response.IndexOf("ARTIST")...

Strings encoded ASCII and UTF8 have different lengths!

I'm reading a stream and am wondering why the UTF-8 encoded string is shorter than the ASCII one. ASCIIEncoding encoder = new ASCIIEncoding(); UTF8Encoding enc = new UTF8Encoding(); string response = encoder.GetString(message, 0, bytesRead); //4096 string responseUtf8 = enc.GetString(message, 0, bytesRead); //3955 ...

Soap Envelope Header in Delphi 7 not including utf-8 encoding. How can I modify it?

I'm having problems receiving invalid non-ascii characters coming from a Delphi 7 client sending a utf-8 encoded XML to a C# WebService in a String parameter. With a .Net client, the characters are received without a problem. I've tried a lot of stuff, and nothing seemed to work, so I decided to trace the SOAP conversation with Wireshark...

any idea what video encoding technology youtube is using?

i was wondering if anyone knew what video/audio encoding technology youtube is using. i heard they started with ffmpeg but am unsure ...

External javascript writes in latin-1

Hi dear stackers, I'm a bit stuck, given my page includes an external Javascript which uses document.write. The problem is my page is UTF-8 encoded, and the contents written are encoded in latin-1, which causes some display problems. Is there any way to handle this ? -- Thanks in advance, Rolf ...

Can Oracle encoding be set in connection-string?

My test-database has a AL32UTF8 encoding, however the production database has a WE8ISO8859P1 encoding. My application is writen in .NET and I use the default System.Data.OracleClient.OracleConnection class to make the connection. I create a IDbCommand and I add IDbDataParameter objects when I want to INSERT some strings with non ASCII s...

Expression Encoder 4 assembly within ASP.NET, IIS7.5 and VS2010

Hello Stack Overflow Community, We have a problem whilst trying to implement an expression encoder assembly into our project and running it through IIS 7.5. We are using VS2010 and .NET4. We have ensured the project is targetting x86 cpu type and when running our application within the VS development server everything is fine. When we...

Problems encoding\decoding strings JS <-> C#

Hi all, I have a problem in JS encoding and then decoding in the C# server. I use javascript encode() function - but when i have special chars like +, the C# has httputility.urldecode() -> and it converts it as if it was SPACE char. What is the best way to communicate JS encoding and C# decoding? I have <a href='javascript:foo(escape(...

How can I base64-encode unicode strings in JavaScript and Python?

I need an encript arithmetic, which encript text to text. the input text could be unicode, and the output should be a-z A-Z 0-9 - . (64 char max) and it could be decrypt to unicode again. it should implement in javascript and python. If there is already some library could do this, great, if there is not, could you tell me. Let me ta...

.NET: Reading/writing binary string

EDIT: Don't answer; I've found the solution on my own. I have some code that does this: using (var stream = new FileStream(args[1], FileMode.Create)) { using (var writer = new BinaryWriter(stream)) { writer.Write(ip.Iso3166CountryCode); ... } } Iso3166CountryCode is a string with two characters ("US"). When I try to read "US"...

How to post data from JS to C#

Hi I have Jquery & ASP.NET server side. I am looking for a way to safely post data from a client to the server and vise versa without worrying of special characters like ",'~ etc... Is JSON a better way? Thanks ...

How could I encode a string of 1s and 0s for transport?

For a genetic algorithm application, I'm using a whole load of binary strings. Most of the time they literally take the form of 01001010110, so that they can be mated, mutated and "crossed-over". For transport and storage however, this seems wasteful. What's the simplest way to encode this as a shorter string? I'm guessing this is pret...

Why does MySQL use latin1_swedish_ci as the default?

Does anyone know why latin1_swedish is the default for MySQL. It would seem to me that UTF-8 would be more compatible right? Defaults are ussually chosen because they are the best universal choice, but in this case it does not seem thats what they did. ...

ASP.NET encoding problem

I need to fill textbox with russian text from query string: region.Text = Request.QueryString["r"]; When I redirect to this page on server (with Response.Redirect) or on client (by document.location) there are no problems with encoding. When I simply go to page in the text field are encoded characters (like ���). How to solve this prob...

What's a sensible way to represent a binary genome for a genetic algorithm?

My previous question belied my inexperience and was based on an assumption. Now I am much wiser. (Put 1s and 0s in a string? Pah! I laugh at the suggestion!) My question is then, how should I encode my genomes? On paper, they look like this: 01010011010110010 17 bits that encode (in some cases singly and in some cases as groups) the...

Base64 Encoding safe for filenames?

Is Base64 encoding safe to use for filenames on windows and linux systems? From my research I have found replacing all "/" characters of the output string with "-" or "_" should resolve any issues. Can anyone provide more details on this? Currently in Java I am using the following peice of code: MessageDigest md5Digest = MessageDi...

Encoding for Return value

I´ve got this javascript: <a href="javascript:addtext('q');">q</a> When it is clicked it writes text on a textarea. I went through the encoding and found can do things like this: This will add a " " (Space) <a href="javascript:addtext('%20');">Space</a> And this will add an "á" <a href="javascript:addtext('&aacute;');">á</a> N...

XMLReader -- Getting problem with utf characters

Hi, I am parsing a huge xml file and encoding of file is to be said < ? xml version="1.0" encoding="ISO-8859-1" ?>**bold The db encoding is utf8 and I am running this query before anything is saved to db $sql='SET NAMES "utf8" COLLATE "utf8_swedish_ci"'; What the problem is that sometimes some non standard characters comes in the ...

Java String.codePointAt returns unexpected value.

If I use any ASCII characters from 33 to 127, the codePointAt method gives the correct decimal value, for example: String s1 = new String("#"); int val = s1.codePointAt(0); This returns 35 which is the correct value. But if I try use ASCII characters from 128 to 255 (extended ASCII/ISO-8859-1), this method gives wrong value, for exam...