Questions tagged [encoding]

Encoding is a set of predefined rules to reversibly transform a piece of information in a certain representation into a completely different representation. The other way round is called decoding. This tag is rather generic, but it is mainly used for binary encoding schemes such as base 64 and hexadecimal.

There are a lot of different applications:

  • which is how the computer represents characters like a and , which humans can recognize, into bytes, which computers can recognize.
  • which is used to transform between videos and bytes.
  • which is used to transform between plain text and valid URIs. Also known as .
  • which is used to transform between plain text and valid XML.
  • which is used to compress/decompress bytes.
24174 questions
8
votes
1 answer

rails paypal notify validate Japanese

When I receive a notification from Paypal, I send it back to Paypal to be sure it is from Paypal. The code works well and I have no problem: # payment_notifications_controller.rb # notification_validation, line 90 response =…
dalf
  • 582
  • 4
  • 11
8
votes
5 answers

Any way to reliably compress a short string?

I have a string exactly 53 characters long that contains a limited set of possible characters. [A-Za-z0-9\.\-~_+]{53} I need to reduce this to length 50 without loss of information and using the same set of characters. I think it should be…
diolemo
  • 2,621
  • 2
  • 21
  • 28
8
votes
3 answers

What would make Ant execute 'javac' in Eclipse with UTF-8 instead of my system default Cp1252?

The last week I've been trying to figure out why some stream decoding my newly adopted application is doing was giving me some major encoding problems. Finally I figured out that the problem was that the JARs/WAR being built with Ant and deployed to…
codeLes
  • 3,021
  • 3
  • 29
  • 27
8
votes
2 answers

How to output Byte Order Mark when writing to TextWriter?

i am writing text to a TextWriter. i want the UTF-16 Byte Order Mark (BOM) to appear in the output: public void ProcessRequest(HttpContext context) { context.Response.ContentEncoding = new UnicodeEncoding(true, true); …
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
8
votes
5 answers

how to convert an image into base64 string

I want to convert image to base 64 encode to string. from that to send to server with oma_status-icon xml format. but I am getting unsupported encoding from the server response.... is there any other way to convert image to base64…
SubbaReddy PolamReddy
  • 2,083
  • 2
  • 17
  • 23
8
votes
5 answers

Encoding apostrophe

i am building up a string on the server that is getting put into a javascript variable on the client. what is the best of encoding this to avoid any issues right now on the server i am doing something like this: html = html.Replace("'",…
leora
  • 188,729
  • 360
  • 878
  • 1,366
8
votes
1 answer

Check if character exists in encoding

I am writing a program that a part renders a bitmap font in CP437. In a function that renders the text with I want to be able to check whether a char is available in CP437 before the encoding conversion, like: public static void DrawCharacter(this…
Alvin Wong
  • 12,210
  • 5
  • 51
  • 77
8
votes
5 answers

.Net 8-bit Encoding

I'm working on serial port, transmitting and receiving data to some hardware at 8bit data. I would like to store it as string to facilitate comparison, and preset data are stored as string or hex format in xml file. I found out that only when using…
faulty
  • 8,117
  • 12
  • 44
  • 61
8
votes
2 answers

Handling bad UTF-8 from json,in ruby

I'm pulling data from remote json at http://hndroidapi.appspot.com/news/format/json/page/?appid=test . The problem I'm running into is that this API appears to be building the JSON without correctly handling UTF-8 encoding (correct me if I'm wrong…
hodgesmr
  • 2,765
  • 7
  • 30
  • 41
8
votes
2 answers

Cannot implicitly convert type string to byte[]

I have a class that encrypts a password with a salted hash. But If I want to pass a null to the class I get the following error: Cannot implicitly convert type string to byte[] Here is the class code: public class MyHash { public static string…
MataHari
  • 318
  • 3
  • 6
  • 15
8
votes
3 answers

How to map a byte[] property with Hibernate?

I'm using Hibernate/Java to persist an entity to a database. The entity has a password field which is a String. When registring a user in my application, I hash the password using SHA-1 (I acknowledge this is a little weak). This produces a byte[]…
Sayo Oladeji
  • 741
  • 4
  • 15
  • 28
8
votes
3 answers

Ruby String.encode still gives "invalid byte sequence in UTF-8"

In IRB, I'm trying the following: 1.9.3p194 :001 > foo = "\xBF".encode("utf-8", :invalid => :replace, :undef => :replace) => "\xBF" 1.9.3p194 :002 > foo.match /foo/ ArgumentError: invalid byte sequence in UTF-8 from (irb):2:in `match' Any ideas…
drewinglis
  • 434
  • 1
  • 3
  • 13
8
votes
3 answers

SDL Tridion - Published files are not UTF-8 Encoded

I've set the publication target within SDL Tridion to push files (aspx) as UTF-8. The pages are published but i'm still seeing some weird encoding issues when rendered in a browser. I can edit the files on the server using notepad and save them as…
johnwinter
  • 3,624
  • 15
  • 24
8
votes
3 answers

AVRO Validation

Am fairly new to AVRO so please excuse if am missing anything obvious. Is there an AVRO validator/commandline utility that validates input against an AVRO schema ? Or probably points to where the error is in the json input.
airboss
  • 1,767
  • 3
  • 16
  • 21
8
votes
4 answers

PHP File Encoding

I recently noticed that the file encoding of the pages I create in my editor are all over the place. Some are saved as ANSI, some are "UTF-8 Without BOM". I am referring to PHP, HTML, CSS, JavaScript files. What is the best format to save my files…
user1108996
  • 275
  • 2
  • 4
  • 13