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 | ZeroMQ 비동기 클라이언트/서버 패턴 | makersweb | 2020.08.13 | 1843 |
14 | AGL (Automotive Grade Linux) 개요 | makersweb | 2022.06.19 | 1903 |
13 | Nana, C++용 크로스플랫폼 GUI 라이브러리 | makersweb | 2021.01.06 | 2100 |
12 | Wayland IVI Extension 간단 리뷰 | makersweb | 2019.05.12 | 2272 |
» | Flutter Application 에서 한글(EUC-KR) 깨져서 나오는 문제 | makersweb | 2022.01.06 | 2758 |
10 | 리눅스에서 SDL2 최신버전 컴파일과 Qt Creator로 개발환경 구성 | makersweb | 2019.10.06 | 3066 |
9 | [SDL2 와 OpenGL]윈도우 생성과 2D그래픽 | makersweb | 2020.04.11 | 3113 |
8 | 가볍고 쉬운 임베디드용 그래픽 라이브러리 - LVGL | makersweb | 2020.09.16 | 3513 |
7 | webOS소개 및 Raspberry Pi 3 에서 실행 | makersweb | 2019.10.13 | 3911 |
6 | 텔레그램(Telegram) Bot 개발 | makersweb | 2019.07.21 | 5745 |
5 | ZeroMQ의 기본 메세지 패턴들 | makersweb | 2020.07.31 | 8632 |
4 | GENIVI DLT(Diagnostic Log and Trace) 활용 | makersweb | 2020.11.19 | 8697 |
3 | Dear ImGui, 경량의 C++ 용 GUI 및 Widget 라이브러리 | makersweb | 2020.11.28 | 9174 |
2 | GDBus 튜토리얼(GDBus tutorial) | makersweb | 2019.06.30 | 10474 |
1 | Pluma(C++ Plug-in Management Framework) 튜토리얼 | makersweb | 2019.12.07 | 14061 |