encoding

imsmanifest.xml should be utf-8 or not (Scorm 1.2)

Should I save imsmanifest.xml in UTF-8 or ANSI ? ADL test suite 1.2 seem to fail with UTF8 header, but on otherhand some LMSes will fail if its not UTF8. ...

Conversion from javascript-escaped Unicode to Java Unicode

I have a query string passed in through an HTTP request that has this character in it: %u54E6 And I'd like to generate a string that contains the actual Chinese character so I can use it in a different part of the application, I've tried using this code: String foo = "%u54E6"; String ufoo = new String(foo.replaceAll("%u([a-zA-Z0-9]{4}...

Setting up your editor: indentation and encoding

Hi there, I'm developing a small project with some friends and we're facing some indentation issues. Each of us is using a different editor (we all have different favorites :) and we also are on different operating systems. What is the best solution to be able to all develop together and set our programming editors so indentation and e...

vba code for excel - to encoding gibrish to hebrew

i have files that open with excel. when i open the file the text is like gibrish. i need to encode - tools-internet option - general-encode - hebrew iso-visual and then the file turn to hebrew there is a vba code that do that ? thanks, omri ...

NFS File names Chars outside the ASCII standard?

Well i have implemented my own NFS server and everything is working good but how do i encode chars that arent part of the ASCII standard? the XDR RFC says that strings are encoded as ascii that would then remove all non ascii chars? but if i start up a nfs server that i havent written it seems to have support for those chars... Iv tryed...

Do I need to encode strings (eg URL) I pass as a POST form parameter

Hi Do I need to encode strings (eg URL) I pass as a POST form parameter? Ie I want to pass a URL I have to my web application (ruby on rails) as one of the form parameters. So are there any potential characters in a URL/URI that would need to be encoded? Or perhaps rails would handle this anyway? ...

C# method to do URL encoding?

Hi what c# class method can I use to URL encode a URL string? In my use case I want to pass a URL string as a URL parameter itself. So like burying a URL within a URL. Without some encoding the "&" and "?" characters in the inner URL can get picked up when the parameters for the outer Url parameters are processed thanks ...

Encode unc path for firefox in ASP.NET

Hi! I need to encode a path so firefox can open it directly. I've tried HttpUtility.UrlEncode, HttpUtility.HttpEncode and HttpUtility.HtmlEncode but none of these seem to work. Any ideas? ...

How to create ZIP files with specific encoding

Hello, On my Linux server I have some files with accented names (test-éàïù.zip). When I add them to a new ZIP file using 7zip command-line tool, the charset/encoding information is not saved and when opened on a Windows computer, the archive does not correctly display filenames. I know that 7zip creates Zip V1.0 archives, not 2.0. Maybe...

URL parameter encoding/receiving problem

hi all, I use the below code to send data to a servlet: When encoding = "UTF-8" or "GBK", the data is received correctly. But when encoding = "UTF-16", The receiver receives null. WHY?? The Sender: URL url = new URL(notifyURL); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); connection.setDoOutput(true); ...

How do I convert an array on the client into a byte[] on the server?

I have a class that encrypts and decrypts a string. It uses rijndael. Anyways, I am trying to store an encrypted value on the client. That works all fine and dandy. My problem is when I want to decrypt the value, I need the Key and IV(InitVector) that was used to encrypt the string. They are byte[] values. I currently output those to the...

Why does php DOM parsing affect charset?

$dom = new DOMDocument(); $dom->loadHTML($string); $dom->preserveWhiteSpace = false; $elements = $dom->getElementsByTagName('span'); $spans = array(); foreach($elements as $span) { $spans[] = $span; } foreach($spans as $span) { $span->parentNode->removeChild($span); } return $dom->saveHTML(); //return $string; When I use this code t...

Url link encoding within XSLT

I'm trying to link to a SharePoint page from an HTML document produced using an XSL transformation, but it keeps complaining that the link is invalid: <a href="site.aspx?List={5r45d0e2-f7eb-4658-a585-3277gr4327ee}&amp;RootFolderUrl=url&amp;Name=name">My Link</a> Obviously, the link is full of unusual characters, and I'm not too sure h...

How to redirect all console output to a Swing JTextArea/JTextPane with the right encoding?

Hi, I've been trying to redirect System.out PrintStream to a JTextPane. This works fine, except for the encoding of special locale characters. I found a lot of documentation about it (see for ex. mindprod encoding page), but I'm still fighting with it. Similar questions were posted in StackOverFlow, but the encoding wasn't addressed as...

Ensuring valid utf-8 in PHP

Hello, I'm using PHP to handle text from a variety of sources. I don't anticipate it will be anything other than UTF-8, ISO-8859-1, or perhaps WINDOWS-1252. If it's anything other than one of those, I just need to make sure the text gets turned into a valid UTF-8 string, even if characters are lost. Does the //TRANSLIT option of icon...

Why do I get encoding error in python warnings.formatwarning on format string?

I get encoding error on this line: s = "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message) UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 44: ordinal not in range(128) I tried to reproduce this error by passing all combinations of parameters to string format, but closest I got was "ascii ...

How to fix encoding in Python Mechanize?

Hello, here is the sample code: from mechanize import Browser br = Browser() page = br.open('http://hunters.tclans.ru/news.php?readmore=2') br.form = br.forms().next() print br.form The problem is that server return incorrect encoding (windows-cp1251). How can I manually set the encoding of the current page in mechanize? Error: Tra...

Encoding/Decoding strange issue

Hi all, This line of code, which decodes an encoded Chinese word: URLDecoder.decode("%E4%BB%BB%E4%BD%95%E8%BD%A6%E8%BE%86%E5%BA%94", "UTF-8").getBytes().length When I run it in a JSP page (on Jboss) it prints 5: <%= URLDecoder.decode("%E4%BB%BB%E4%BD%95%E8%BD%A6%E8%BE%86%E5%BA%94", "UTF-8").getBytes().length %> Running...

Encoding patterns in a 2D space (matrix)

I have a 2D MxN grid (or matrix). The cells in the matrix may hold an integer. A cell with a non-zero integer is said to be populated. The set of populated cells in the matrix is known as a "configuration". I want to come up with an encoding or hashing algorithm that wil allow me to uniquely identify a configuration in the matrix, by co...

Encoding java Cookie value

Hi! How should you encode the actual value for a Java Cookie object? I cannot pass characters like '=' or any character outside US-ASCII. /Br joynes ...