summaryrefslogtreecommitdiff
path: root/FS/FS/Misc.pm
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2018-01-24 00:43:57 -0600
committerMitch Jackson <mitch@freeside.biz>2018-03-01 02:57:29 +0000
commitd476d0554f9a995a983edb014a0d7fe350e8c6ab (patch)
tree15b88c56ce186cc86fdcfacabb9fb7f8dd25057e /FS/FS/Misc.pm
parent6a11197ad8040edeace3132ff40670073d5557f7 (diff)
RT# 77144 replace bytes_substr with Unicode::Truncate
Diffstat (limited to 'FS/FS/Misc.pm')
-rw-r--r--FS/FS/Misc.pm26
1 files changed, 14 insertions, 12 deletions
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
index 669c44e..d84aace 100644
--- a/FS/FS/Misc.pm
+++ b/FS/FS/Misc.pm
@@ -22,7 +22,6 @@ use Encode;
generate_ps generate_pdf do_print
csv_from_fixed
ocr_image
- bytes_substr
money_pretty
);
@@ -982,23 +981,26 @@ sub ocr_image {
=item bytes_substr STRING, OFFSET[, LENGTH[, REPLACEMENT] ]
+DEPRECATED
+ Use Unicode::Truncate truncate_egc instead
+
A replacement for "substr" that counts raw bytes rather than logical
characters. Unlike "bytes::substr", will suppress fragmented UTF-8 characters
rather than output them. Unlike real "substr", is not an lvalue.
=cut
-sub bytes_substr {
- my ($string, $offset, $length, $repl) = @_;
- my $bytes = substr(
- Encode::encode('utf8', $string),
- $offset,
- $length,
- Encode::encode('utf8', $repl)
- );
- my $chk = $DEBUG ? Encode::FB_WARN : Encode::FB_QUIET;
- return Encode::decode('utf8', $bytes, $chk);
-}
+# sub bytes_substr {
+# my ($string, $offset, $length, $repl) = @_;
+# my $bytes = substr(
+# Encode::encode('utf8', $string),
+# $offset,
+# $length,
+# Encode::encode('utf8', $repl)
+# );
+# my $chk = $DEBUG ? Encode::FB_WARN : Encode::FB_QUIET;
+# return Encode::decode('utf8', $bytes, $chk);
+# }
=item money_pretty