encoding

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : http://myapp.com/objects/1?auth%5Fcode=833fe7bdc789dff996f5de46075dcb409b4bb4f0 However it is too long and I think I might be able to "com...

Encoding of window.location.hash

Does window.location.hash contain the encoded or decoded representation of the url part? When I open the same url (http://localhost/something/#%C3%BC where %C3%BCtranslates to ü) in Firefox 3.5 and Internet Explorer 8, I get different values for document.location.hash: IE8: #%C3%BC FF3.5: #ü Is there a way to get one variant in both...

All characters of the c# application shown as square character in only one computer

Hi everyone, I have a .net 3.5 application written in c# and it works fine except in one windows 2003 server. In that server all characters of the application shown as square characters. i have another windows 2003 server with exactly the same regional settings but application works fine in that server. Also when i copied the square cha...

Problem in utf-8 encoding PHP + MySQL

hi,i moved data from mysql 4 (they were originally set to latin2 encoding) to mysql 5 and set encoding to utf-8. It looks good in phpMyAdmin, utf-8 is ok. But there are question marks instead of some characters on website! website encoding is also set to utf8 so i dont understand where is the problem. PHP and HTML files are also set to ...

mysql encoding problems

I am dealing with some external APIs, and when I save to the db, I am receiving some encoding errors, All the content I am dealing with is in unicode; but the mysql encoding is set ti latin1. It seems to work fine on my local system, but throws error on the server. The only difference between the environments is that the local runs pyth...

what is encoding in Ajax?

Generally we are using UTF-8 encoding standard for sending the request for every language. But in some language this encoding standard is not working properly,then in that case we are using ISO-8859-1. ...

Using Java PDFBox library to write Russian PDF

Hello , I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It seems the problem is in the font used, but i am not so sure about that, so i hope if anyone could guide me through this. Here is the i...

Mysql: latin1-> utf8. Convert characters to their multibyte equivalents

There was a table in latin1 and site in cp1252 I want to have table in utf8 and site in utf-8 I've done: 1) on web page: Content-Type: text/html;charset=utf-8 2) Mysql: ALTER TABLE XXX CONVERT TO CHARACTER SET utf8 _ This SQL doesn't work as I want - it doesn't convert ä & ü characters in database to their multibyte equivalents Pl...

Best way to decode unknown unicoding encoding in Python 2.5

Have I got that all the right way round? Anyway, I am parsing a lot of html, but I don't always know what encoding it's meant to be (a surprising number lie about it). The code below easily shows what I've been doing so far, but I'm sure there's a better way. Your suggestions would be much appreciated. import logging import codecs from ...

WCF - choosing best suited binding/encoders

I have a client server application in which the communication between the client and the server is by WCF. My WCF services are supposed to be consumed only by my clients. ie, I am not bother about the service interoperability. The service might not be in same network as with my client application. And It would be hosted the service in I...

PowerShell scripts on GitHub

PowerShell $OutputEncoding defaults to ASCII. PowerShell by default represents strings in Unicode. When I create scripts using the ISE, they are created in Unicode. The following command sends text to a file in Unicode: echo Testing > test.txt When I push these files to GitHub, the code view chokes on them because they aren't UTF-8...

Reading RSS feed with Linq-to-XML and C# - how to decode CDATA section?

Hi there, I am trying to read an RSS feed using C# and Linq to XML. The feed is encoded in utf-8 (see http://pc03224.kr.hsnr.de/infosys/feed/) and reading it out generally works fine except for the description node because it is enclosed in a CDATA section. For some reason I can't see the CDATA tag in the debugger after reading out th...

Python - Get a list of all the encodings python can encode to

I am writing a script that will try encoding bytes into many different encodings in python 2.6. This page http://www.python.org/doc/2.6/library/codecs.html?highlight=cp1250#id3 lists all the encodings that python can encode to. Rather than copy & paste that, is there some way to get a list of available encodings that I can iterate over? ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks ...

What is the equivalent of JavaScript's encodeURIcomponent in PHP?

What is the equivalent of JavaScript's encodeURIcomponent in PHP? ...

URL encoding issue - HttpWebRequest doesn't work, Firefox does

I'm trying to call a rest webservice provided by a lims system (basically a chemistry lab database + interface). It was working great until some > ascii characters showed up (specifically characters with circumflexes, umlauts, etc.) When calling the webservice passing the value àèïõû I have the following argument: &componentValue=àè...

Mojarra for JSF Encoding

Hello. Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don't know what to do with ...

With a utf8-encoded Perl script, can it open a filename encoded as GB2312?

I'm not talking about reading in the file content in utf-8 or non-utf-8 encoding and stuff. It's about file names. Usually I save my Perl script in the system default encoding, "GB2312" in my case and I won't have any file open problems. But for processing purposes, I'm now having some Perl script files saved in utf-8 encoding. The probl...

Java: cannot parse and display non-utf8 characters read from an http request

Hello, I'm using Java to parse this request http://ajax.googleapis.com/ajax/services/search/web?start=0&amp;rsz=large&amp;v=1.0&amp;q=rz+img+news+recordid+border which has as a result this (truncated for the sake of brevity) JSON file: {"responseData":{"results": <...> "visibleUrl":"www.coolcook.net", "cacheUrl":"http://www.google....

Ruby: Convert encoded character to actual UTF-8 character

Ruby will not play nice with UTF-8 strings. I am passing data in an XML file and although the XML document is specified as UTF-8 it treats the ascii encoding (two bytes per character) as individual characters. I have started encoding the input strings in the '\uXXXX' format, however I can not figure out how to convert this to an actual...