aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarved <arved@FreeBSD.org>2009-07-25 00:28:37 +0800
committerarved <arved@FreeBSD.org>2009-07-25 00:28:37 +0800
commit28c51a9b8726aa32bacb5fd5e7a931ac9ac1a97b (patch)
tree6984244bb3e7f4b44cb5fb5b4b12ee330f80d525
parent724bea06af74c534eae3d843ffc58d8335b85747 (diff)
downloadfreebsd-ports-gnome-28c51a9b8726aa32bacb5fd5e7a931ac9ac1a97b.tar.gz
freebsd-ports-gnome-28c51a9b8726aa32bacb5fd5e7a931ac9ac1a97b.tar.zst
freebsd-ports-gnome-28c51a9b8726aa32bacb5fd5e7a931ac9ac1a97b.zip
Fix import of UTF8 encoded OFX files
PR: 137051 Submitted by: takawata
-rw-r--r--finance/libofx/Makefile1
-rw-r--r--finance/libofx/files/patch-utf8_fix34
2 files changed, 35 insertions, 0 deletions
diff --git a/finance/libofx/Makefile b/finance/libofx/Makefile
index 8c37fbf50ec1..e58ef984577d 100644
--- a/finance/libofx/Makefile
+++ b/finance/libofx/Makefile
@@ -7,6 +7,7 @@
PORTNAME= libofx
PORTVERSION= 0.9.1
+PORTREVISION= 1
CATEGORIES= finance
MASTER_SITES= SF
diff --git a/finance/libofx/files/patch-utf8_fix b/finance/libofx/files/patch-utf8_fix
new file mode 100644
index 000000000000..c4b61faee6c1
--- /dev/null
+++ b/finance/libofx/files/patch-utf8_fix
@@ -0,0 +1,34 @@
+add file attached as files/patch-utf8_fix and recompile it.
+
+Patch attached with submission follows:
+
+--- lib/ofx_preproc.cpp.orig 2009-07-24 18:48:05.000000000 +0900
++++ lib/ofx_preproc.cpp 2009-07-24 20:34:52.000000000 +0900
+@@ -151,7 +151,7 @@
+ fromcode=LIBOFX_DEFAULT_INPUT_ENCODING;
+ }
+ }
+- else if(ofx_encoding.compare("USASCII")==0) {
++ else if(ofx_encoding.compare("UTF-8")==0) {
+ fromcode="UTF-8";
+ }
+ else
+@@ -170,6 +170,16 @@
+ header_name.assign(s_buffer.substr(0,header_separator_idx));
+ header_value.assign(s_buffer.substr(header_separator_idx+1));
+ message_out(DEBUG,"ofx_proc_file():Header: "+header_name+" with value: "+header_value+" has been found");
++
++ if((header_separator_idx = header_value.find('\r', 0))
++ != std::string::npos)
++ header_value.resize(header_separator_idx);
++
++ if((header_separator_idx = header_value.find('\n', 0))
++ != std::string::npos)
++ header_value.resize(header_separator_idx);
++
++
+ if(header_name.compare("ENCODING")==0) {
+ ofx_encoding.assign(header_value);
+ }
+
+