cp949 0.1.0 copy "cp949: ^0.1.0" to clipboard
cp949: ^0.1.0 copied to clipboard

outdated

CP949 Encoder/Decoder

dart-cp949 #

CP949 (EUC-KR 포함)을 Encode, Decode 해 주는 라이브러리입니다.

license .nvmrc yarn:devDependency Conventional Commits Commitizen friendly pr welcome

🚧 Under construction #

개발중입니다.

Installation #

dependencies:
  cp949: ^0.0.1

Why? #

Dart 는 non-unicode 인코딩/디코딩을 native 하게 지원하지 않습니다. 글을 쓰는 시점으로 CP949 지원하는 라이브러리는 이 프로젝트가 유일해 보입니다.

Usage #

decode() #

CP949 (EUC-KR) byte 배열을 (List<int>) 받아 dart 의 native String 을 리턴합니다.

import 'package:cp949/cp949.dart' as cp949;

const cp949CodeUnitBytes = [0xBE, 0xC6, 0xB8, 0xA7, 0xB4, 0xD9, 0xbf, 0xee];
print(cp949.decode(cp949CodeUnitBytes)); // "아름다운" 출력

encode() #

dart 의 native String 을 받아 CP949 (EUC-KR) byte 배열로 (List<int>) 리턴합니다.

import 'package:cp949/cp949.dart' as cp949;

print(cp949.encode("아름다운")); // "[0xBE, 0xC6, 0xB8, 0xA7, 0xB4, 0xD9, 0xbf, 0xee]" 출력

Example #

import 'package:http/http.dart' as http;
import 'package:cp949/cp949.dart' as cp949;

const url = "https://euc-kr-encoded-website.co.kr";
final response = await http.get(url);
print(cp949.decode(response.bodyBytes));

Development (Contribution) #

이 project 는 마크다운 린트, 커밋 메세지 린트 등 개발환경 설정을 위해 yarn과 nodejs package 들을 사용합니다.

yarn install
yarn test
yarn format:md .
yarn format .

License #

MIT License. Copyright © 2020, GIL B. Chan <bnbcmindnpass@gmail.com>

9
likes
15
pub points
60%
popularity

Publisher

unverified uploader

CP949 Encoder/Decoder

Repository (GitHub)
View/report issues

Documentation

Documentation

License

MIT (LICENSE)

More

Packages that depend on cp949