Comments (7)
Actually I used var outputArray = Encoding.convert(inputArray, 'UNICODE', 'SJIS');
already. But I need to convert to UTF8 because I'm importing data into Salesforce platform. So the way I fixed this problem is not to use Encoding.codeToString
. Instead of that, I came up with using
function arrayToString(uintArray) {
var encodedString = String.fromCharCode.apply(null, uintArray),
decodedString = decodeURIComponent(escape(encodedString));
return decodedString;
}
from encoding.js.
Encoding.codeToString uses String.fromCharCode.apply(null, code)
internally. Just making sure not to cause an RangeError when it is a large string.
from encoding.js.
Thanks for your reminding me of potential problems. I should apply library's method with a little bit of change
function arrayToString(uintArray) {
var encodedString = Encoding.codeToString(uintArray);
var decodedString = decodeURIComponent(escape(encodedString));
return decodedString;
}
from encoding.js.
Actually, the method codeToString should not be used in this case. It seems to be used for 16bit-based converting
from encoding.js.
What is originalText string?
from encoding.js.
hello, originalText is data was read from file which is in SJIS encode
from encoding.js.
Maybe, I think that the character code you are looking for is "Unicode".
"Unicode" is JavaScript's encoding, "UTF-8" is not JavaScript internal encoding.
var outputArray = Encoding.convert(inputArray, 'UNICODE', 'SJIS');
from encoding.js.
Related Issues (15)
- ASCIIに判定されたものを変換しようとすると例外をはくようになった問題 HOT 1
- Conflict another function or object Jquery
- [Browserify] Cannot find module in v1.0.28 HOT 4
- ES6のmoduleへの対応をしてほしい
- Western Windows1252 detected as SJIS HOT 2
- Creating a LICENSE file HOT 2
- Encoding.detectでUTF-8N形式のファイルがUNICODEに分類されます
- 特定の文字を含んだ Unicode を SJIS に変換しようとすると文字化けする HOT 3
- Hello, could you support SJIS-WIN encoding?
- Remove invalid characters after decoding
- error when using detect function HOT 1
- Bug: string.charCodeAt is not a function HOT 2
- esm support?
- Vue3に対応してますか? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from encoding.js.