Skip to content

Commit

Permalink
Replace some non-ascii characters
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey committed Sep 21, 2020
1 parent b9527f3 commit 73a08ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## [0.4.8]

- Replace some non-ascii characters

## [0.4.7]

- Printing a long text col splits the data to the next row (case when col contains chinese characters taking 2 bytes)
Expand Down
7 changes: 7 additions & 0 deletions lib/src/ticket.dart
Expand Up @@ -66,6 +66,13 @@ class Ticket {
}

Uint8List _encode(String text, {bool isKanji = false}) {
// replace some non-ascii characters
text = text
.replaceAll("’", "'")
.replaceAll("´", "'")
.replaceAll("»", '"')
.replaceAll(" ", ' ')
.replaceAll("•", '.');
if (!isKanji) {
return latin1.encode(text);
} else {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,6 +1,6 @@
name: esc_pos_utils
description: Basic Flutter/Dart classes for ESC/POS printing. Ticket class generates ESC/POS commands that can be sent to a thermal printer.
version: 0.4.7
version: 0.4.8
homepage: https://github.com/andrey-ushakov/esc_pos_utils

environment:
Expand Down

0 comments on commit 73a08ac

Please sign in to comment.