Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: felixge/node-formidable
base: v0.9.2
...
head fork: felixge/node-formidable
compare: v0.9.3
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 4 additions and 15 deletions.
  1. +3 −14 lib/formidable/incoming_form.js
  2. +1 −1  package.json
View
17 lib/formidable/incoming_form.js
@@ -5,7 +5,7 @@ var sys = require('sys')
, WriteStream = require('fs').WriteStream
, MultipartParser = require('./multipart_parser').MultipartParser
, QuerystringParser = require('./querystring_parser').QuerystringParser
- , Utf8Decoder = require('utf8decoder').Utf8Decoder
+ , StringDecoder = require('string_decoder').StringDecoder
, EventEmitter = require('events').EventEmitter;
function IncomingForm() {
@@ -130,21 +130,10 @@ IncomingForm.prototype.handlePart = function(part) {
if (!part.filename) {
var value = ''
- , decoder;
-
- if (this.encoding.toLowerCase() == 'utf-8') {
- decoder = new Utf8Decoder();
- decoder.onString = function(str) {
- value += str;
- };
- }
+ , decoder = new StringDecoder(this.encoding);
part.addListener('data', function(buffer) {
- if (decoder) {
- decoder.write(buffer);
- } else {
- value += buffer.toString(self.encoding);
- }
+ value += decoder.write(buffer);
});
part.addListener('end', function() {
View
2  package.json
@@ -1,5 +1,5 @@
{ "name" : "formidable"
-, "version": "0.9.2"
+, "version": "0.9.3"
, "dependencies": {"gently": ">=0.7.0"}
, "directories" : { "lib" : "./lib/formidable" }
, "main" : "./lib/formidable/index"

No commit comments for this range

Something went wrong with that request. Please try again.