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-02-28 20:39:36 -0600
commitfaf4866cd552cc40045fd048ac77ea8f2bece2d3 (patch)
tree25155eaf278c61406ff1e30474b92bb292090941 /FS/FS/Misc.pm
parent6635b3ee826a8dcd8755c4a1277f3ae268889f1e (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