simon-git: charset (master): charset.git

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Nov 12 17:50:11 GMT 2016


TL;DR:
  534a872 Rename test.c to convcs.c.
  355c172 convcs: add an option-parsing framework.
  bf1f8be convcs: add a '--replacement' option.
  08c3385 convcs: optional third filename argument.
  d97d7fd convcs: read with fgets, not fread.
  5dc58db convcs: permit "-" to designate the locale's charset.

Repository:     https://git.tartarus.org/simon/charset.git
On the web:     https://git.tartarus.org/?p=simon/charset.git
Branch updated: master
Committer:      charset.git
Date:           2016-11-12 17:50:11

commit 534a8729d09ed62d28b135805d2bf923204448a9
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=534a8729d09ed62d28b135805d2bf923204448a9;hp=5b2be6e7930ccb52fbe4176077b7171f4828f6f9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:05:59 2016 +0000

    Rename test.c to convcs.c.
    
    It's confusing to have it called something totally different from the
    binary it produces.

 Makefile |  4 ++--
 convcs.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 test.c   | 72 ----------------------------------------------------------------
 3 files changed, 74 insertions(+), 74 deletions(-)

commit 355c172be103972ad4e2e6232a7cffb53f6f4a8f
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=355c172be103972ad4e2e6232a7cffb53f6f4a8f;hp=534a8729d09ed62d28b135805d2bf923204448a9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:08:09 2016 +0000

    convcs: add an option-parsing framework.
    
    Currently the only option is --help, but I'm about to add another one.

 convcs.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 51 insertions(+), 9 deletions(-)

commit bf1f8be5a62b129d1515838c65b03817b9399667
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=bf1f8be5a62b129d1515838c65b03817b9399667;hp=355c172be103972ad4e2e6232a7cffb53f6f4a8f
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:36:44 2016 +0000

    convcs: add a '--replacement' option.
    
    This permits me to specify what text I want to see in my output if a
    character in the input can't be translated between the two specified
    in the source text. The default is libcharset's own default of U+FFFD,
    or the empty string if U+FFFD itself has no representation in the
    output charset.
    
    This is a bit fiddly because I have to assume that the replacement
    text is given on the command line in the _locale_ charset rather than
    in the destination charset. So I have to translate it into Unicode
    from whatever charset_from_locale() returns, and then translate it
    into the destination charset on demand.

 convcs.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 101 insertions(+), 12 deletions(-)

commit 08c3385292967a4ceffe4b238944749ffd1bc4df
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=08c3385292967a4ceffe4b238944749ffd1bc4df;hp=bf1f8be5a62b129d1515838c65b03817b9399667
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:42:55 2016 +0000

    convcs: optional third filename argument.
    
    I always get annoyed with 'tr' when it doesn't let me specify a
    filename as a third argument ('tr a-z A-Z file_I_want_to_uppercase'),
    so I shouldn't perpetrate the same UI inflexibility in a program of my
    own with the same shape of command-line syntax.

 convcs.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

commit d97d7fdcbdd236837d1ae21ba82b7ed97c9c60c5
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=d97d7fdcbdd236837d1ae21ba82b7ed97c9c60c5;hp=08c3385292967a4ceffe4b238944749ffd1bc4df
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:45:37 2016 +0000

    convcs: read with fgets, not fread.
    
    This has nicer buffering behaviour - if you run convcs reading
    interactively from standard input, now each line of input will be
    translated and printed immediately.

 convcs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

commit 5dc58dbc3743acbac96f1a6ad4e182eed8d0cdf8
web diff https://git.tartarus.org/?p=simon/charset.git;a=commitdiff;h=5dc58dbc3743acbac96f1a6ad4e182eed8d0cdf8;hp=d97d7fdcbdd236837d1ae21ba82b7ed97c9c60c5
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 17:48:50 2016 +0000

    convcs: permit "-" to designate the locale's charset.
    
    If I have a document I know to be in (say) CP437 and I want to display
    it as best I can in my actual terminal, I shouldn't have to grub
    around in my memory to remember that my terminal's encoding is UTF-8
    in order to type that on convcs's command line. It already knows what
    the system charset is, so I should be able to tell it to just use it
    and not bother me with the details.

 convcs.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)



More information about the tartarus-commits mailing list