Encoding error while parsing cyrillic text fields
See original GitHub issueSupport plan
Hello! I found an error while parsing form fields for utf-8 cyrillic. The error lies in the incorrect encoding of text fields.
<html>
<head>
<meta charset="utf-8">
</head>
Hello World!...Cyrillic encoding error
<br>
<form method="post" enctype="multipart/form-data">
<input type="text" name="text" value="абвгд кириллица алфавит" />
<input type="submit" name="submit" value="submit" />
</form>
</html>
app.post("/", function(req, res) {
const form = formidable({ multiples: true });
form.parse(req, (err, fields, files) => {
console.log(fields);
});
res.end();
});
What was the result you got?
Erroneous result of form parsing:
{ text: 'абвгд киÑиллиÑа Ð°Ð»Ñ Ð°Ð²Ð¸Ñ', submit: 'submit' }
What result did you expect?
Expected Result:
{ text: 'абвгд кириллица алфавит', submit: 'submit' }
I created a test to repeat the error on the code sandbox. https://codesandbox.io/s/simple-express-server-rcwvm?file=/src/index.js:834-1248
Context
- node version: v10.20.1
- module (formidable) version: ^2.0.0
- used with express
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top Results From Across the Web
How to solve problem with parsing html file with cyrillic symbol?
I got it to work by decoding the source string - tree = html.fromstring(source.decode('utf-8')) : # -*- coding:cp1251 -*- import lxml from ...
Read more >How To: resolve errors in Designer for non-English...
Characters with incorrect encoding will often appear as boxes or question marks in the Designer Results screen and error messages.
Read more >3 steps to fix encoding problems in Ruby - Justin Weiss
Most encodings are small, and can't handle every possible character. You'll see that error when a character in one encoding doesn't exist in...
Read more >Support non-Unicode character encoding in Azure Logic Apps
When you work with text payloads, Azure Logic Apps infers the text is encoded in a Unicode format, such as UTF-8.
Read more >Processing Text Files in Python 3 - Nick Coghlan's Python Notes
Unicode Error Handlers¶ · backslashreplace : this is an encoding error handler that converts code points that can't be represented in the target...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Published
formidable@2.0.0-canary.20200504.1
, which includes couple of other things since last published canary.Thank you very much! Great job!