Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/ASCIIfy.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ ASCIIfy <- function(x, bytes = 2, fallback = "?") {
} else {
ascii <- fallback
warning(char, " could not be converted to 1 byte")
}
} else if (length(raw) == 2 && bytes == 2) { # UTF-8 to \u0000
} # UTF-8 to \u0000
} else if (nchar(format.hexmode(utf8ToInt(char))) <= 4 && bytes == 2) {
ascii <- paste0("\\u", format.hexmode(utf8ToInt(char), width = 4))
} else {
ascii <- fallback
warning(char, " could not be converted to ", bytes, " byte")
warning(char, " could not be converted to ", bytes, " bytes")
}
return(ascii)
}
Expand Down
5 changes: 3 additions & 2 deletions inst/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
gtools 3.9.6
--------------------------
gtools 3.9.6 - development
---------------------------

- improve `ASCIIfy()` so it handles a wider range of Unicode characters.
- add `hyphen.separator` argument to `mixedorder`/`mixedsort`

gtools 3.9.5 - 2023-11-20
Expand Down
Loading