Permalink
Browse files

Don't mangle non-ASCII output filenames

  • Loading branch information...
1 parent 9d13f64 commit eb122ce8af8f84d08f43193d7b619456b7eba175 @pghmcfc committed Jul 29, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/config.c
View
@@ -904,7 +904,10 @@ Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval
TidyBuffer inbuf; /* Set up input source */
tidyBufInitWithAllocator( &inbuf, doc->allocator );
tidyBufAttach( &inbuf, (byte*)optval, TY_(tmbstrlen)(optval)+1 );
- doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII );
+ if (optId == TidyOutFile)
+ doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, RAW );
+ else
+ doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII );
doc->config.c = GetC( &doc->config );
status = option->parser( doc, option );

1 comment on commit eb122ce

Owner

pghmcfc commented on eb122ce Jul 29, 2011

This is a fix for Fedora Bug http://bugzilla.redhat.com/725651 in which non-ASCII output filenames get mangled:

$ touch 中文.html
$ tidyp -f 中文.html.stderr -output 中文.html.stdout 中文.html
$ ls
中??!.html.stdout  中文.html  中文.html.stderr
Please sign in to comment.