Flutter Application(Windows 플랫폼)에서 시리얼 장치의 정보 및 통신을 위해 libserialport 패키지를 사용할 때 한글 문자열이 정상적으로 출력되지 않았다.
그럴 때는 dart-cp949 패키지를 사용한다.
import 'package:flutter/material.dart';
import 'package:cp949/cp949.dart' as cp949;
import 'package:flutter_libserialport/flutter_libserialport.dart';
...
final port = SerialPort(address);
cp949.decodeString(port.description);
or
cp949.decode(port.description.codeUnits);
...
CP949 (EUC-KR) 데이터를 유니코드 기반으로 잘못 해석하여 깨져 보이는 String 을 올바른 문자열로 decode 해준다.
굿.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
15 | C++를 위한 Lottie 라이브러리 with SDL2 | makersweb | 2021.08.15 | 979 |
14 | NAppGUI, C언어용 크로스 플랫폼 GUI 라이브러리 | makersweb | 2022.10.10 | 907 |
13 | Protocol Buffers 를 이용한 직렬화 with Conan Package Manager | makersweb | 2021.02.24 | 883 |
12 | VSCode 와 Qbs 플러그인으로 C/C++ 개발환경 구성 | makersweb | 2021.09.12 | 878 |
11 | ZeroMQ 를 이용한 Qt 응용프로그램 간 통신 | makersweb | 2021.08.28 | 876 |
10 | 윈도우에서 안드로이드 flutter 프로그래밍 개발환경 구축(with Visual Studio Code) | makersweb | 2020.09.16 | 810 |
9 | Chromium과 Ozone 층 | makersweb | 2022.03.03 | 756 |
8 | Windows에서 Qt Creator + CMake + vcpkg 로 C++ 개발환경 구성 (POCO 라이브러리 DirectoryWatcher 예제) | makersweb | 2023.01.14 | 725 |
7 | 라즈베리파이에서 Redis의 Pub/Sub 패턴을 사용하는 Electron 응용프로그램 | makersweb | 2021.01.31 | 692 |
6 | 라즈베리파이4에서 openFrameworks 예제 실행 | makersweb | 2020.12.13 | 566 |
5 | CopperSpice 에 대해서 (C++ Gui 라이브러리) | makersweb | 2022.01.02 | 555 |
4 | OTA 오픈소스 프로젝트 | makersweb | 2022.08.03 | 502 |
3 | 도커(docker)설치 및 기본 명령어 | makersweb | 2019.12.02 | 488 |
2 | Flutter 위젯의 상태관리에 대해서 | makersweb | 2023.04.06 | 469 |
1 | openFrameworks 한글 폰트 설정 및 출력하기 | makersweb | 2023.02.19 | 227 |