Permalink
Browse files

Add warning if $UNICODE flag is detected

  • Loading branch information...
1 parent b67cd3d commit a829a8675d279330b2a20503561e3c84a89327f1 @b4winckler committed Feb 21, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/lxbread.c
View
@@ -131,6 +131,11 @@ map_t parse_text(const char *text, long size)
char *p = data;
for (;;) {
+ // FIXME: FCS 3.0 allows the separator character to appear in keys and
+ // values by repeating the separator twice -- this is currently NOT
+ // handled.
+ // For example, if sep='/' then "k//ey/value/" should be parsed as
+ // "k/ey"="value", whereas we parse it as { "k"="", "ey"="value" }.
char *key = strsep(&p, sep);
if (!key) break;
char *val = strsep(&p, sep);
@@ -174,6 +179,14 @@ bool check_par_format(map_t txt)
return false;
}
+ const char *unicode = map_get(txt, "$UNICODE");
+ if (*unicode) {
+ // FIXME: Support Unicode. We try to parse the data even if the text
+ // segment contains Unicode characters, so don't return false here.
+ fprintf(stderr, " Unsupported LXB: Unicode flag detected,"
+ " output may be corrupted\n");
+ }
+
init_parameter_mask(txt);
for (int i = 0; i < npar; ++i) {

0 comments on commit a829a86

Please sign in to comment.