encoding

php curl, xml content character problem.

Hello I just start to develop php what I want to do is to get xml contents from another site but when i get it like this $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_ENCODING => "UTF-8", // handle compressed CURLOPT_USERAGE...

Why won't my Servlet respond to JSON requests in UTF-8?

My Servlet just won't use UTF-8 for JSON responses. MyServlet.java: public class MyServlet extends HttpServlet { protected void doPost(HttpServletRequest req, HttpServletResponse res) throws Exception { PrintWriter writer = res.getWriter(); res.setCharacterEncoding("UTF-8"); res.setContentType("application/json; charse...

How do I check if a file is text-based?

I am working on a small text replacement application that basically lets the user select a file and replace text in it without ever having to open the file itself. However, I want to make sure that the function only runs for files that are text-based. I thought I could accomplish this by checking the encoding of the file, but I've found ...

Using a "custom" user ID as opposed to the user's real, auto_incremented database ID in web applications ?

I'm not sure about its terminology, but for http://www.somedomain.com/user/123456, the "custom user ID" I'm referring to is 123456. I have seen this on quite a lot of websites, in fact, even SO uses something similar. What I'm curious about is: What are they ? - I guess they can't be the real, auto_incremented user ID from the database...

Why don't my Facebook share links work if they have spaces in them yet are encoded (asp.net mvc)?

Here's my code for my Facebook share link: <a href="<%= HttpUtility.UrlPathEncode("http://www.facebook.com/sharer.php?u=http://www.apoads.com"+ Request.Url.PathAndQuery) %>" title="Share on Facebook" rel="nofollow" target="_blank"><img src="/Content/Img/Png/SocialIcons/facebook_16.png" width="16" height="16" alt="share on facebook" /></...

ASP vs .NET database encoding issue

I have an old classic ASP application that stores information in a SQL Server 2008 database. I need to retrieve the information in a new .NET application but I am having some encoding issues. When I look in SQL Management Studio or at the data retrieved in .NET text strings looks weird when it contain Danish characters, e.g “Øvrige” wh...

Auto encoding detect in C#

Possible Duplicate: Determine a string's encoding in C# Many text editorsr (like Notepad++) can detect encoding of arbitrary file. Can I detect encodoing of file in C#? ...

Image transfer between C++ and Java via Socket

Hi everyone, I would like to transfer an image from a Java application to a C++ application. I am using sockets as the communication method, and for now this works good with strings. I want to be able to transmit it both way (Java <-> C++). The image is NOT a file, this is a memory object/structure. So my main problem is how to encode...

What kind of encoding is this ?

MV5BMTIy***MTk3NDcyMQ@@._V1._SX96_SY140_.jpg etc etc ? i think these are urls encoded .... but not sure .. imdb uses something like this but i need to know for another site which is ripping some1 off and i dont know who ^^ ...

Encoding calling from pyodbc to a MS SQL Server

I am connecting to a MS SQL server through SQL Alchemy, using pyodbc module. Everything appears to be working fine, until I began having problems with the encodings. Some of the non-ascii characters are being replaced with '?' The DB has a collation 'Latin1_General_CI_AS' (I've checked also the specific fields and they keep the same col...

encoding guidelines to avoid issues with streams

Hello everyone, What are the guidelines i should follow to avoid encoding issues when reading files or converting string to bytes, bytes to streams streams to reader etc. Any important notes, tutorials would also help. Best Regards, Keshav ...

Garbled Text in uniqueidentifier in SQLite

Hi Dear All, I am having a problem using Sqlite with .Net/visual studio and need your help very much. The problem is: I have garbled text in the ID column with data type 'uniqueidentifier' in Sqlite Database when viewing table data via some GUI tools (I try different tools) It shows fine when retriving data in .net code, but just mak...

Arabic presentation forms B support in c#

I was trying to convert a file from utf-8 to Arabic-1265 encoding using the Encoding APIs in C#, but I faced a strange problem that some characters are not converted correctly such as "لا" in the following statement "ﻣﺣﻣد ﺻﻼ ح عادل" it appears as "ﻣﺣﻣد ﺻ? ح عادل". Some of my friends told me that this is because these characters are from ...

What is the most accurate encoding detector?

After certain survey, I come to discover that there are a few encoding detection project in java world, if the getEncoding in InputStreamReader does not work: juniversalchardet jchardet cpdetector ICU4J However, I really do not know which is the best among the all. Can anyone with hand-on experience tell me which one is the best in J...

Video encoded by Expression Encoder is 3 seconds long on YouTube

Hi, I am trying to upload video created using MS Expression Encoder 4 to YouTube, but after processing any video is played in 3 seconds. Any ideas? Is it problem of encoder configuration or YouTube? Thank you. ...

does utf-8 encoding messes file globbing and grep'ing?

I'm playing with bash, experiencing with utf-8 encoding. I'm new to unicode. The following command (well, their output) surprises me : $ locale LANG="fr_FR.UTF-8" LC_COLLATE="fr_FR.UTF-8" LC_CTYPE="fr_FR.UTF-8" LC_MESSAGES="fr_FR.UTF-8" LC_MONETARY="fr_FR.UTF-8" LC_NUMERIC="fr_FR.UTF-8" LC_TIME="fr_FR.UTF-8" LC_ALL= ...

Java FileReader error

Hi I'm a beginner of Java lauguage. It seems like my computer does not recognize FileReader at all.(Random class does not work either.) I typed the exact same code in a different computer and it worked. I uninstalled JDK and reinstalled it, but still doesn't work. I don't know what to do. My environment Samsung Netbook N150 plus. /// ...

When did it become OK to use UTF-8?

When did people start using UTF-8 in files encoding and HTTP Content-Type headers? Since all web servers, OSes, text editors and browsers support it today, when did it become "compatible" between these? ...

PHP - add/remove carriage returns to a base 64 encoded string

Hi I have a verrrrrrrry long base64 encoded string which is displayed in a textarea. The problem is that this string doesn't have any spaces or carriage returns so it gets displayed on one line with a ugly horizontal scroll bar. Can I add somehow carriage returns manually after base64_encode() and before output to the textarea, then re...

Probleme with string encoding in SOAP

Hello, I have an application in Flex3 and when I send an Soap Query, I have a corect enveloppe, but when I try the same code in Flex 4, the sting is encoding : exemple : Flex 3 : <ns1:orderLine> <ns1:line_nr>2</ns1:line_nr> <ns1:productCode>7443</ns1:productCode> <ns1:quantity>20</ns1:quantity> </ns1:orde...