encoding

Java String Encoding to UTF-8

Hi All, I have some HTML code that I store in a Java.lang.String variable. I write that variable to a file and set the encoding to UTF-8 when writing the contents of the string variable to the file on the filesystem. I open up that file and everything looks great e.g. shows up as a right arrow. However, if the same String (containing ...

Hibernate Encoding

Hi. Im trying to insert data with japanese characters to an oracle database. The things is what is saved in the database are bunch of inverted question marks. HOw do I resolve this ...

How to Find Default Charset/Encoding in Java?

The obvious answer is to use Charset.defaultCharset() but we recently found out that this might not be the right answer. I was told that the result is different from real default charset used by java.io classes in several occasions. Looks like Java keeps 2 sets of default charset. Does anyone have any insights on this issue? We were abl...

What is the encoding of an .eml file from IIS's SMTP server?

I need to write a program that read the .eml files from IIS's mail drop box, but I can't find a definitive source that tells me the encoding of the .eml files. Is there a specification somewhere that tells me the encoding of the files, or do I just have to guess/assume one? ...

Data rate and frame rate property

Hello everybody, I convert a file using ffmpeg command in which audio and video bitrate are specified. But when i play the converted file into totem player or vlc media player then audio and video bitrate in properties section are being displayed "N/A" whereas it must be same as these are specified in command. ffmpeg -i 'in.wmv' -s 12...

How to get ASP.NET HyperLink control to encode ampersands in Text attribute?

I use the following control to output a HTML link: <asp:HyperLink ID="hlEditDetails" runat="server" CssClass="arrow-forward" Text="Edit Details &amp; Photo" /> However, when it does, the markup is generated as: <a id="ctl00_hlEditDetails" class="arrow-forward" href="/EventName/EditDetails.aspx?ID=1">Edit Details & Photo</a> The une...

PHP - UTF8 problem with German characters.

Hello, I'm at my wits end with this one, then I remember stack overflow. I have a site, http://bridgeserver3.co.uk/disklavier/de/ , the language is stored in a simple PHP file which looks like.. $translations["welcome_text_3"]="Zum Lieferumfang eines jeden Disklaviers gehšren bereits zahlreiche Lieder und das Angebot lŠsst sich jederz...

encoding a string to ascii

I have a long string that I want to encode to ascii. I'm doing: s = s.encode('ascii', 'replace') but I get: 'ascii' codec can't decode byte 0xc3 in position 2646: ordinal not in range(128) (I've also tried 'ignore' but it doesn't help.) What am I doing wrong?? ...

System.Text.Encoding isn't

I've tracked a problem I'm having down to the following inexplicable behaviour within the .NET System.Text.Encoding class: byte[] original = new byte[] { 128 }; string encoded = System.Text.Encoding.UTF8.GetString(original); byte[] decoded = System.Text.Encoding.UTF8.GetBytes(encoded); Console.WriteLine(original[0] == decoded[0]); Am ...

How do you think Google is handling this encoding issue?

I recently came across an encoding issue specific to how Firefox encodes URLs directly entered into the address bar. It basically looks like the default Firefox character encoding for URLs is NOT UTF-8, which is the case with most browsers. Additionally, it looks like they are trying to make some intelligent decisions as to what characte...

XmlSerializer Utf-8 encoding

Consider the code below XmlSerializer serializer = new XmlSerializer(typeof(Invoice)); using (TextWriter writer = new StreamWriter(fileName)) { // Serialize the object, and close the TextWriter. serializer.Serialize(writer, invoice); writer.Close(); } No encoding is set on the stream writer by default. Does it def...

Runtime.getRuntime().exec() with a non-ASCII string in Windows?

Trying the following method to open an Arabic URL: String cmd = "cmd.exe /C start \"Open file\" \"http://ar.wikipedia.org/wiki/موسوعة\""; Runtime.getRuntime().exec( cmd ); Unfortunately, the URL being opened is http://ar.wikipedia.org/wiki/?????? Any thoughts on why this is or how I could prevent this? Before you ask why I don...

encodeURIComponent for double quotes disappears on form action

Hi, I'm trying to pass a url like: my_url = 'http://somedomain.com/somepath/somepage?key="query"'; when someone clicks on a form. I tried using encodeURI and encodeURIComponent and even using alerts to see that I have either "query" or %22query%22 because I call something like document.my_form.action = my_url but when the browser hi...

Sybase ASE character set with OLEDB .NET

Using the .NET Framework 2.0 on a computer with the LCID set to 1033, I am connecting to a Sybase ASE 12.5.4 server which has its default character set to sjis. When I retrieve fields which contain Japanese text, I must, in code, convert each field from cp1252 to cp932 to display the text properly. However, when I set the computer to L...

Why are some characters shown as question marks when sending email using non-English characters?

I tried to send a text email with non-English characters using PHPs mail function. But instead my message went with funny looking garbage characters. How do I fix it? I use this piece of code: function _mail($to, $subject, $content) { $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Ma...

Are ASCII characters always encoded the same way in all character encodings?

In ASCII, the character < is encoded as a single-byte character 0x3C, what I'd like to know is that is there a character set where < is encoded differently? I tried UTF-8, it's the same. I tried GB2312 and it's the same... Another question, are all ASCII characters the same in all character sets? ...

detect UTF-16 file content

Is it possible to know if a file has unicode (16-byte per char) or 8-bit ASCII content ? ...

Alternative to Base64 encoding

Are there any alternative to Base64 encoding? I don't have any issues using Base64, just want to be aware of alternatives. ...

US-ASCII encoding with Odd and Even numbers?

I splitted the list of numbers 1-100 to files of 2 bytes. Then, I noticed that each odd number btw 11-99 needs 2 files, ie 4bytes, while each even number btw 11-99 needs 1 file, 2bytes. A file is enough for numbers btw 1-10. You can confirm the finding below. How can you explain the finding? What did I do? save numbers to a file, lik...

Switch website encoding from ISO-8859-1 to UTF-8

I am trying to convert my existing PHP webpage to use UTF-8 encoding. To do so, I have done the following things: specified UTF-8 as the charset in the meta content tag at the start of my webpage. change the default_charset to UTF-8 in the php.ini. specified UTF-8 as the iconv encoding in the php.ini file. specified UTF-8 in my .htacc...