https://github.com/id1945/ngx-shift-jis
This library is built for the purpose of loading files in "shift jis" format.
https://github.com/id1945/ngx-shift-jis
angular angular2 angular4 encoding-japanese ngx ngx-shift-jis shift-jis
Last synced: 5 months ago
JSON representation
This library is built for the purpose of loading files in "shift jis" format.
- Host: GitHub
- URL: https://github.com/id1945/ngx-shift-jis
- Owner: id1945
- License: mit
- Created: 2021-09-11T07:06:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T09:33:59.000Z (about 3 years ago)
- Last Synced: 2025-10-24T08:56:07.548Z (9 months ago)
- Topics: angular, angular2, angular4, encoding-japanese, ngx, ngx-shift-jis, shift-jis
- Language: TypeScript
- Homepage: https://id1945.github.io/ngx-shift-jis
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ngx-shift-jis
This library is built for the purpose of loading files in "shift jis" format.\
This is the [demo](https://stackblitz.com/edit/angular-ngx-shift-jis?file=src/app/app.component.ts).

## Installation
Install `ngx-shift-jis` from `npm`:
```bash
npm install ngx-shift-jis@ --save
```
Add wanted package to NgModule imports:
```typescript
import { NgxShiftJisModule } from 'ngx-shift-jis';
@NgModule({
imports: [
NgxShiftJisModule,
]
})
```
Add component to your page:
```typescript
import { NgxShiftJisService } from 'ngx-shift-jis';
export class AppComponent {
constructor(public shiftJis: NgxShiftJisService) { }
public download() {
const content = '説明会内容 1,あああ,いいい 2,ううう,えええ';
const fileName = 'demo-Shift-JIS.csv';
this.shiftJis.downloadShiftJIS(content, fileName).subscribe(console.log);
}
}
```
```html
Download
```
Encoding :hammer_and_wrench:
```typescript
public download() {
const content = '説明会内容 1,あああ,いいい 2,ううう,えええ';
const fileName = 'demo-Shift-JIS.csv';
const convert = (encoding) => {
const num_array = encoding.stringToCode(content);
const sjis_array = encoding.convert(num_array, "SJIS", "UTF8");
return sjis_array;
}
this.shiftJis.downloadShiftJIS(content, fileName, convert).subscribe(console.log);
}
// convert(data: IntArrayType, to: Encoding, from?: Encoding)
// Encoding: 'UTF32' | 'UTF16' | 'UTF16BE' | 'UTF16LE' | 'BINARY' | 'ASCII' | 'JIS' | 'UTF8' | 'EUCJP' | 'SJIS' | 'UNICODE' | 'AUTO'
```
#### Support download file formats
| File format |
| ------------- |
| text |
| csv |
| word |
| excel |
| powerpoint |
#### Support versions
Support versions
Angular 16
1.1.1
Angular 6
1.1.0
#### Author Information
Author Information
Author
DaiDH
Phone
+84845882882
Country
Vietnam
#### If you want donate for me!
Bitcoin

[MIT License](https://github.com/id1945/ngx-shift-jis/blob/master/LICENSE) Copyright (c) 2021 DaiDH