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 해준다.

굿.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 16 |
C++를 위한 Lottie 라이브러리 with SDL2
| makersweb | 2021.08.15 | 3891 |
| 15 |
ZeroMQ 를 이용한 Qt 응용프로그램 간 통신
| makersweb | 2021.08.28 | 3151 |
| 14 |
VSCode 와 Qbs 플러그인으로 C/C++ 개발환경 구성
| makersweb | 2021.09.12 | 3441 |
| 13 |
Flutter/Dart 와 Qt/QML 비교
| makersweb | 2021.11.07 | 3456 |
| 12 |
CopperSpice 에 대해서 (C++ Gui 라이브러리)
| makersweb | 2022.01.02 | 3424 |
| » |
Flutter Application 에서 한글(EUC-KR) 깨져서 나오는 문제
| makersweb | 2022.01.06 | 5925 |
| 10 |
Chromium과 Ozone 층
| makersweb | 2022.03.03 | 3070 |
| 9 |
AGL (Automotive Grade Linux) 개요
| makersweb | 2022.06.19 | 5459 |
| 8 | OTA 오픈소스 프로젝트 | makersweb | 2022.08.03 | 3035 |
| 7 |
NAppGUI, C언어용 크로스 플랫폼 GUI 라이브러리
| makersweb | 2022.10.10 | 3944 |
| 6 |
Windows에서 Qt Creator + CMake + vcpkg 로 C++ 개발환경 구성 (POCO 라이브러리 DirectoryWatcher 예제)
| makersweb | 2023.01.14 | 2709 |
| 5 |
LVGL 을 통해 GUI 구현 시 한글 폰트 추가
| makersweb | 2023.02.07 | 5159 |
| 4 |
openFrameworks 한글 폰트 설정 및 출력하기
| makersweb | 2023.02.19 | 1950 |
| 3 |
[NodeGui] JavaScript로 데스크탑 응용프로그램 작성
| makersweb | 2023.02.21 | 5425 |
| 2 |
Flutter 위젯의 상태관리에 대해서
| makersweb | 2023.04.06 | 2621 |
| 1 |
Elastic Stack 에 대해서
| makersweb | 2024.08.25 | 2516 |