encoding

What causes my XML to break?

I have the following XML code. <firstname> <default length="6">Örwin</default> <short>Örwin</short> <shorter>Örwin</shorter> <shortest>�.</shortest> </firstname> Why does the content of the "shortest" node break? It should be a simple "Ö" instead of the tedious �. XML is UTF-8 encoded and the function which processes the output of...

How do I ensure the British Pound Sterling Sign (£) appears correctly?

I have a PHP script that reads in data from an XML file, returns it via AJAX to a page which then places the data in to the relevant text area. The Content-Type of the page is as follows: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> The XML heading looks like this: <?xml version="1.0" encoding="UTF-8"?> <!D...

Fix file endcoding when downloading a file from Linux to Windows in php

Ok I have an issue. I have a linix web server (RHEL 4 with apache 2) that is used to house an application. Part of this application is a set of php scripts. I created a script that accepts some form variables and then downloads a file to the user. Here si the code: header('Content-Description: File Transfer'); header('Content-Type: ...

obfuscate or encrypt some plain text data in PHP

I need to obfuscate or encrypt some plain text data in my php 5.2 application. I'd prefer a solution that would have input string and output string retain the same length. This does not need to extremely strong, as there are numerous other layers of security in place. Strong would be good, but this will just keep programmers/dba/suppo...

API for streaming audio

Hi Can you recommand a API to prorammatically feed sound data (wav or something) into to get in the end an streaming server someone can connect to with e.g. winamp? In my szenario I have some wave samples and would like to "create" sounds/music with them streaming the result to an audience on the fly. My prefered language is C++ (on Re...

Why would I use a Unicode Signature Byte-Order-Mark (BOM)?

Are these obsolete? They seem like the worst idea ever -- embed something in the contents of your file that no one can see, but impacts the file's functionality. I don't understand why I would want one. ...

The Point of Bencoding

Lately i have been messing around with bittorrent protocol. I fail to see the point in bencoding files other than giving me headache in parsing them? What advantages does it have? Why not use xml? /sarcasm ...

WebService: Difference between my pc and server

I have a bug where special characters (danish 'ø' in this case) are shown correctly when running locally, but wrong when the code runs on a server (I get a pipe '|'). I was trying to solve this today, but I did not have access to the server, other than updating the code files. I will limited access monday, so I can at least write inter...

How do you take an image (passed in as a Base64 encoded string) and save it to the server in Asp.Net C#?

I want to create a function like this... [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveImage(string file, string fileName) { } Where the file is the Base64 encoded string created from the image, and the fileName is the name I want to save it as. How can I use this encoded string to write the image to the serve...

display chinese character in eclipse console output

Hi, I am trying to display some Chinese characters in the GB2312 encoding in the eclipse console. I realize that in Run Dialog -> Common tab -> Console Encoding, I can choose additional encodings other than the default CP1252. However, how I can add additional encodings, like GB2312? Thanks. ...

how to control charset of directory listing via .htaccess?

Hi all, I've enabled directory listing of a folder under public_html, by adding: Options +Indexes in the .htaccess file. However, some files are not listed correctly by default, as some filenames are in Chinese (UTF-8 encoded). I can see the filenames if the change the browser's charset encoding to UTF-8. How can I let the browser ...

Converting hebrew text to an image using imagemagick

Hi, I need to convert text to an image. Using imagemagick I can get this done. However, part or all of the text could be in Hebrew (an RTL language). This means the words in Hebrew are rendered backwards. If I was assured that the text was only Hebrew, I would have just reversed the text before sending it to ImageMagick. However, this so...

How can I get a hex dump of a string in PHP?

I'm investigating encodings in PHP5. Is there some way to get a raw hex dump of a string? i.e. a hex representation of each of the bytes (not characters) in a string? ...

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...

What exactly is sun.jnu.encoding?

What is the purpose of the system property sun.jnu.encoding? Various fragments on the web set or report it, but I can't find a definition. ...

UTF Encoding in java

I need to encode a message from request and write it into a file. Currently I am using the URLEncoder.encode() method for encoding. But it is not giving the expected result for special characters in French and Dutch. I have tried using URLEncoder.encode("msg", "UTF-8") also. Example: Original message: Pour gérer votre GSM After encod...

Is there a way to store a string longer than 25 characters into a hexadecimal string shorter than 25 characters and have it reversible?

Sorry if the title doesn't make sense. Basically I have a series of strings that are 10-60 characters long. The problem being is the service I have to use only accepts strings up to 25 so I need a way to convert the strings I have to 25 characters or less, send it off and when I get the results back be able to convert it back to the orig...

Sql Server Row Concatenation

Hi all, I have a table (table variable in-fact) that holds several thousand (50k approx) rows of the form: group (int) isok (bit) x y 20 0 1 1 20 1 2 1 20 1 3 1 20 0 1 2 20 0 2 1 21 1 ...

jQuery send HTML data through POST

I am using jQuery to make a POST to a PHP file with the HTML content of a div. The HTML content contain tables, inputs, smaller divs and I would like to grab the content of the main DIV and send it to the database. The only option I could think of is the POST method but I don't know if I can send plain HTML with it. Are there any other o...

Windows Service non-Unicode Encoding Problem

Hi, I'm working on a simple windows service which reads csv data and transfer the data to ms-sql server. Csv contains non-unicode chars(Ç窺İıÖöÜüĞğ). ODBC doesn't transfer the right endocing. I try the copy data without ODBC, with text reading, encoding doesn't right too. But text encoding is right when I debug the service. Csv read co...