-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utf8 problem in _third_party_main.js #10673
Comments
I can confirm this. It was introduced in #5458. @bnoordhuis, does V8 require two-byte external strings to be aligned? It would be nice to have a |
@bnoordhuis should work, except (probably) endianness on some architectures. Basically I just did the same thing but with a |
Hi, i need to load csv file with polish symbol. I have tried every praser i found. Always same result as @Tunga37. Have you managed to solve this issue? U can contact me https://www.facebook.com/kamil.lewandowski.3532507 or here. I would appreciate. |
@Kamill90 this is definitely not the issue that @Tunga37 reported, and not related to Node at all, actually, just the libraries you have tried or that how you use them. CSV parsing happens in userland while this issue is about core libraries compiled into Node's binary. You can ask for help in https://github.com/nodejs/help/issues. |
@bnoordhuis your fix doesn't work for me because I work on node7.5 when this fix is for your version of io.js ( at least I think so) Local<String> MainSource(Environment* env) {
auto maybe_string =
String::NewExternalOneByte(
env->isolate(),
&internal_bootstrap_node_external_data);
return maybe_string.ToLocalChecked();
} when it used to be Local<String> MainSource(Environment* env) {
return String::NewFromUtf8(
env->isolate(),
reinterpret_cast<const char*>(internal_bootstrap_node_native),
NewStringType::kNormal,
sizeof(internal_bootstrap_node_native)).ToLocalChecked();
} @Kamill90 |
@Tunga37 the fix being put forward by @bnoordhuis would land in Node.js master and would be picked back into our |
Thank You All |
Detect it when source files in lib/ are not ASCII. Decode them as UTF-8 and store them as UTF-16 in the binary so they can be used as external string resources without non-ASCII characters getting mangled. Fixes: nodejs#10673 PR-URL: nodejs#11129 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Detect it when source files in lib/ are not ASCII. Decode them as UTF-8 and store them as UTF-16 in the binary so they can be used as external string resources without non-ASCII characters getting mangled. Fixes: nodejs#10673 PR-URL: nodejs#11129 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Detect it when source files in lib/ are not ASCII. Decode them as UTF-8 and store them as UTF-16 in the binary so they can be used as external string resources without non-ASCII characters getting mangled. Fixes: #10673 PR-URL: #11129 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Detect it when source files in lib/ are not ASCII. Decode them as UTF-8 and store them as UTF-16 in the binary so they can be used as external string resources without non-ASCII characters getting mangled. Fixes: #10673 PR-URL: #11129 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Since version 7.1 (node.js) there is a problem with utf8 chars, but only when you put your code into the file lib/_third_party_main.js (this path has to be included in node.gyp)
let say _third_party_main.js looks like this
(function () {
"use strict";
console.log("pchnąć w tę łódź jeża lub ośm skrzyń fig"); //some polish words
}());
if you then run simple ./configure and make
and after long successful process of compilation you will just invoke ./node
then you will get
pchn�� w t� �ódź jeża lub o�m skrzy� fig
utf8 has been destroyed
The text was updated successfully, but these errors were encountered: