encoding

JSON specifies "any UNICODE character"?

Maybe this is just my unfamiliarity with unicode, so please correct me if I'm mistaken. Looking at http://json.org/, the spec says that a string can include "any UNICODE character", but this confuses me. JSON is a communication format correct? At the core of it, everything must translate down to bytes. In contrast, UNICODE is a logic...

How to make TXMLDocument (with the MSXML Implementation) always include the encoding attribute?

I have legacy code (I didn't write it) that always included the encoding attribute, but recompiling it to D2010, TXMLDocument doesn't include the enconding anymore. Because the XML data have accented characters both on tags and data, TXMLDocument.LoadFromFile simply throws EDOMParseErros saying that an invalid character is found on the f...

How to turn string into readable by php server way? (С#)

So I know that my server on real form submit turns %CE%EB%E5%E3+%DF%EA%F3%F8%EA%E8%ED into Олег Якушкин . How to peform string transfer from Олег Якушкин into %CE%EB%E5%E3+%DF%EA%F3%F8%EA%E8%ED using C#? ...

How do I change mysql settings so that it is default UTF-8 for everything?

I am getting "ASCII encoding" errors when I insert into my database because I did a fresh install of the MYSQL. I'd like to change the default to UTF-8 again. This is the error I'm getting because MYSQL is not set in UTF-8 mode: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) ...

Why am I getting this UnicodeEncodeError when I am inserting into the MySQL database?

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128) I changed my database default to be utf-8, and not "latin"....but this error still occurs. why? This is in my.cnf. Am I doing this wrong? I just want EVERYTHING TO BE UTF-8. init_connect='SET collation_connection = utf8_general_c...

Cannot insert non latin symbols in MySQL

I'm writing web-app using MySQL version 5.1.45, Tomcat 5.5.28 and Hibernate 3 When I'm trying to save string that contains non-latin characters (for example Упячка) error occurs: 1589 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1366, SQLState: HY000 1589 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Inco...

Ruby On Rails and UTF-8

I have an Rails application with SayController, hello action and view template say/hello.html.erb. When I add some cyrillic character like "ю", I get an error: ArgumentError in SayController#hello invalid byte sequence in UTF-8 Headers: {"Cache-Control"=>"no-cache", "X-Runtime"=>"11", "Content-Type"=>"text/html; charset=utf-8"} ...

Why does Java automatically decode %2F in URI encoded filenames?

I have a java servlet that needs to write out files that have a user-configurable name. I am trying to use URI encoding to properly escape special characters, but the JRE appears to automatically convert encoded forward slashes %2F into path separators. Example: File dir = new File("C:\Documents and Setting\username\temp"); String f...

What is "=C2=A0" in MIME encoded, quoted-printable text?

This is an example raw email I am trying to parse: MIME-version: 1.0 Content-type: text/html; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Mailer: Verizon Webmail X-Originating-IP: [x.x.x.x] =C2=A0test testing testing 123 What is =C2=A0? I have tried a half dozen quoted-printable parsers, but none handle this correctl...

Can I send a POST form in an encoding other than of its body?

Hi gang, I've Html page that looks like: <HTML> <meta http-equiv='Content-Type' content='text/html; charset=gb2312'> <BODY onload='document.forms[0].submit();'> <form name="form" method="post" action="/path/to/some/servlet"> <input type="hidden" name="username" value="麗安"> <!-- UTF-8 characters --> </form> </BODY> </HTML> As you can ...

Best practice. Do I save html tags in DB or store the html entity value?

Hi Guys, I was wondering about which way i should do the following. I am using the tiny MCE wysiwyg editor which formats the users data with the right html tags. Now, i need to save this data entered into the editor into a database table. Should I encode the html tags to their corresponding entities when inserting into the DB, then w...

Fractal based Image compression algorithm (and source code)

I am looking for a decent fractal based compression algorithm for images. So far I only find dead links to the FIF image format and dead links pointing to Iterated Systems Inc which then became MediaBin which then became nothing from what I can see. ...

Storing strings in MySQL

I've got a C# application which takes a users notes which can include various punctuation marks such as commas, apostrophes, semicolons etc. At the moment I'm getting my application to encode the strings and storing them into the database as base 64. Is there a better way? FYI: I'm using a MySQL through their ODBC driver ...

Why does Silverlight provides webcam and microphone support without any encoding API?

In the list of new features in Silverlight 4 you will find following: Webcam and microphone to allow sharing of video and audio for instance for chat or customer service applications. Silverlight captures an audio stream as raw pcm. So how would you realize for example audio/video chat or client/server audio recording application ...

What is better for PHP developers - Unicode or UTF-8?

What is better for PHP developers - Unicode or UTF-8? I am going to create an international CMS. So I am going to have clients all over the world. They will speak all possible languages. What encoding format is better for browser recognition and for DB data storage? ...

encoding of =1 in emails

Hi folks, I have probably a stupid problem. In a script I generate a URL with GET parameters, something like 'www.mydomain.com/index.php?item=1234'. This URL will be sent by PHP through mail() in an UTF-8 encoding (the scriptfile itself also is utf-8). Now each time I have the GET-Parameter with two numbers after the '=' the URL in the ...

Segmentation fault while feeding in an mpeg file through ffmpeg

Hi, I've set up FFserver as the streaming server. I'm trying to feed in an mpeg file. But it comes up with a segmentation fault. Does anyone know how to fix this? The following is the command-line output I get $ ./ffmpeg -i test1.mpg http://localhost:8090/feed1.ffm FFmpeg version SVN-r22945, Copyright (c) 2000-2010 the FFmpeg d...

Sending JSON(jQuery) to PHP and decoding it

I can't for the life of me figure out what I'm doing wrong. It seems like it should be simple because I can't find anyone else with this issue but I can't figure out to send basic data via javascript(jQuery) to PHP and decode it. For the sake of simplicity, this is what I have: JAVASCRIPT var json_data = { "name" : "john doe" }; $.a...

Diamonds with question marks

Hi, I'm getting these little diamonds with question marks in them in my HTML attributes when I present data from my database. I'm using EPiServer and a few custom properties. This is the information I've gathered, I save my data as a XML document, since I use custom EPiServer properties which need more than one defined value. This is...

Prevent ASP.NET from encoding strings on output

How can I stop ASP.Net from encoding anchor tags in List Items when the page renders? I have a collection of objects. Each object has a link property. I did a foreach and tried to output the links in a BulletedList, but ASP encoded all the links. Any idea? Thanks! Here's the offending snippet of code. When the user picks a specialty, ...