On 8.4.2013 21:38, Janne Hyv?rinen wrote:> Friendly people on Hydrogenaudio found some bugs with the Unicode > printing code, so I was forced to make adjustments. > > While doing testing I noticed that long filenames cause printing bugs > on Linux too. If line length on status printing exceeded console > length it kept printing the same line over and over. > The patch I included fixes encoding side nicely, but on decoding side > there is still minor glitch left. On long lines the final status of > the decoding will still be printed on its own line. > > The Unicode printing patch no longer relies on character counts > returned by fwprintf function as that didn't match reality. And I > switched to use WriteConsole command when output isn't redirected so > that special characters can be printed. They were replaced by question > marks with fwprintf. Fixing fwprintf output would have required > setting console mode to UTF-16 and that would have required all print > functions to be replaced by wide char variants. Use of regular ansi > function would instantly crash the program in that mode. >The long line patch is broken and requires much more work, please ignore it. The other patch is still good. Here's a patch to get working Unicode support for one forgotten print function in metaflac. -------------- next part -------------- diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c index 934cfcf..af17d5b 100644 --- a/src/metaflac/utils.c +++ b/src/metaflac/utils.c @@ -136,7 +136,7 @@ void print_error_with_chain_status(FLAC__Metadata_Chain *chain, const char *form va_start(args, format); - (void) vfprintf(stderr, format, args); + (void) flac_vfprintf(stderr, format, args); va_end(args);
On 08-04-13 22:00, Janne Hyv?rinen wrote:> > On 8.4.2013 21:38, Janne Hyv?rinen wrote: >> Friendly people on Hydrogenaudio found some bugs with the Unicode >> printing code, so I was forced to make adjustments. >> [...] > > The long line patch is broken and requires much more work, please > ignore it. The other patch is still good. > Here's a patch to get working Unicode support for one forgotten print > function in metaflac.I've just verified these patches (the UTF-8 ones, not the long line patch) work for both MSVC as well as MinGW, basic tests (FLAC__TEST_LEVEL = 0) passed. I tested the MSVC build by replacing the binaries of a directory I did the MinGW build in with the MSVC binaries and running the tests again. Handling filenames with Cyrillic and Greek characters finally (fully) works here with these patches, which is great! I only got one warning, win_utf8_io.c:96:5: warning: no previous prototype for 'print_console'
On 10.4.2013 10:39, Martijn van Beurden wrote:> On 08-04-13 22:00, Janne Hyv?rinen wrote: >> On 8.4.2013 21:38, Janne Hyv?rinen wrote: >>> Friendly people on Hydrogenaudio found some bugs with the Unicode >>> printing code, so I was forced to make adjustments. >>> [...] >> The long line patch is broken and requires much more work, please >> ignore it. The other patch is still good. >> Here's a patch to get working Unicode support for one forgotten print >> function in metaflac. > I've just verified these patches (the UTF-8 ones, not the long line > patch) work for both MSVC as well as MinGW, basic tests > (FLAC__TEST_LEVEL = 0) passed. I tested the MSVC build by replacing the > binaries of a directory I did the MinGW build in with the MSVC binaries > and running the tests again. Handling filenames with Cyrillic and Greek > characters finally (fully) works here with these patches, which is great! > > I only got one warning, win_utf8_io.c:96:5: warning: no previous > prototype for 'print_console' > _______________________________________________ >Here's patch version 2 for long line printing bug. I installed latest xubuntu into a virtual machine and tested that at least graphical linux console handles the changes properly. -------------- next part -------------- A non-text attachment was scrubbed... Name: flac_patches_v2.zip Type: application/x-zip-compressed Size: 4147 bytes Desc: not available Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130410/3040e97a/attachment.bin