chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
set content-type charset and LC_CTYPE to UTF-8
[ypp-sc-tools.db-live.git]
/
yarrg
/
CommodsWeb.pm
diff --git
a/yarrg/CommodsWeb.pm
b/yarrg/CommodsWeb.pm
index 0c86e6cbfe0976b20fa6e39f50c057d354486563..5f85511f5fed815f2d73e70e435c710a383e2daa 100644
(file)
--- a/
yarrg/CommodsWeb.pm
+++ b/
yarrg/CommodsWeb.pm
@@
-38,6
+38,7
@@
use warnings;
use DBI;
use POSIX;
use DBI;
use POSIX;
+use JSON;
use Commods;
use CommodsDatabase;
use Commods;
use CommodsDatabase;
@@
-50,7
+51,9
@@
BEGIN {
our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(&dbw_connect &ocean_list $sourcebasedir);
+ @EXPORT = qw(&dbw_connect &ocean_list $sourcebasedir
+ &to_json &to_json_protecttags
+ &set_ctype_utf8);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
@@
-100,4
+103,11
@@
sub dbw_connect ($) {
return dbr_connect($datadir, $ocean);
}
return dbr_connect($datadir, $ocean);
}
+sub to_json_protecttags ($) {
+ my ($v) = @_;
+ my $j= to_json($v);
+ $j =~ s,/,\\/,g;
+ return $j;
+}
+
1;
1;