For Windows, assume outfile & API filename args are in UTF-8,

& use xxxW() APIs accordingly, ticket #288, props Marcel
  **Backwards-incompatible change**
This commit is contained in:
gitlost 2023-05-10 00:47:44 +01:00
parent cc69c86129
commit 15fdca2a03
12 changed files with 151 additions and 47 deletions

View file

@ -1,6 +1,6 @@
% Zint Barcode Generator and Zint Barcode Studio User Manual
% Version 2.12.0.9
% February 2023
% May 2023
# 1. Introduction
@ -561,6 +561,8 @@ created if they don't already exist:
zint -o "dir/subdir/filename.eps" -d "This Text"
```
Note that on Windows, filenames are assumed to be UTF-8 encoded.
## 4.3 Selecting Barcode Type
Selecting which type of barcode you wish to produce (i.e. which symbology to
@ -1626,7 +1628,8 @@ values are 0, 90, 180 and 270.
The `ZBarcode_Encode_File()` and `ZBarcode_Encode_File_and_Print()` functions
can be used to encode data read directly from a text file where the filename is
given in the `NUL`-terminated `filename` string. The special filename `"-"`
(single hyphen) can be used to read from stdin.
(single hyphen) can be used to read from stdin. Note that on Windows, filenames
are assumed to be UTF-8 encoded.
If printing more than one barcode, the `zint_symbol` structure may be re-used by
calling the `ZBarcode_Clear()` function after each barcode to free any output
@ -1809,7 +1812,7 @@ Variable Name Type Meaning Default Value
`.emf`, `.eps`, `.pcx`,
`.svg`, `.tif` or `.txt`
followed by a terminating
`NUL`.
`NUL`.[^8]
`primary` character Primary message data for `""` (empty)
string more complex symbols, with
@ -1910,6 +1913,8 @@ QR Code (including HIBC, Micro QR, rMQR and UPNQR), and Ultracode - all of which
have a fixed width-to-height ratio (or, in the case of Code One, a fixed
height).
[^8]: For Windows, `outfile` is assumed to be UTF-8 encoded.
To alter these values use the syntax shown in the example below. This code has
the same result as the previous example except the output is now taller and
plotted in green.
@ -1939,9 +1944,8 @@ background alpha to `"00"` where the values for R, G and B will be ignored:
## 5.7 Handling Errors
If errors occur during encoding a non-zero integer value is passed back to the
calling application. In addition the `errtxt` variable is used to give a message
detailing the nature of the error. The errors generated by Zint are given in the
table below:
calling application. In addition the `errtxt` variable is set to a message
detailing the nature of the error. The errors generated by Zint are:
--------------------------------------------------------------------------------
Return Value Meaning
@ -2067,10 +2071,10 @@ Value Effect
------------------------- -----------------------------------------------------
0 No options selected.
`BARCODE_BIND_TOP` Boundary bar above the symbol only.[^8]
`BARCODE_BIND_TOP` Boundary bar above the symbol only.[^9]
`BARCODE_BIND` Boundary bars above and below the symbol and between
rows if stacking multiple symbols.[^9]
rows if stacking multiple symbols.[^10]
`BARCODE_BOX` Add a box surrounding the symbol and whitespace.
@ -2095,7 +2099,7 @@ Value Effect
separate colour channels (`OUT_BUFFER` only).
`BARCODE_QUIET_ZONES` Add compliant quiet zones (additional to any
specified whitespace).[^10]
specified whitespace).[^11]
`BARCODE_NO_QUIET_ZONES` Disable quiet zones, notably those with defaults.
@ -2105,13 +2109,13 @@ Value Effect
Table: API `output_options` Values {#tbl:api_output_options tag="$ $"}
[^8]: The `BARCODE_BIND_TOP` flag is set by default for DPD - see [6.1.10.7 DPD
[^9]: The `BARCODE_BIND_TOP` flag is set by default for DPD - see [6.1.10.7 DPD
Code].
[^9]: The `BARCODE_BIND` flag is always set for Codablock-F, Code 16K and Code
[^10]: The `BARCODE_BIND` flag is always set for Codablock-F, Code 16K and Code
49. Special considerations apply to ITF-14 - see [6.1.2.6 ITF-14].
[^10]: Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN, ITF-14, UPC-A and
[^11]: Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN, ITF-14, UPC-A and
UPC-E have compliant quiet zones added by default.
\clearpage
@ -2865,13 +2869,13 @@ Alphabet No. 1 (ISO/IEC 8859-1)].
![`zint -b CODE128AB -d "130170X178"`](images/code128ab.svg)
It is sometimes advantageous to stop Code 128 from using Code Set C which
compresses numerical data. The `BARCODE_CODE128AB`[^11] variant (symbology 60)
compresses numerical data. The `BARCODE_CODE128AB`[^12] variant (symbology 60)
suppresses Code Set C in favour of Code Sets A and B.
Note that the special escapes to manually switch Code Sets mentioned above are
not available for this variant (nor for any other).
[^11]: `BARCODE_CODE128AB` previously used the name `BARCODE_CODE128B`, which is
[^12]: `BARCODE_CODE128AB` previously used the name `BARCODE_CODE128B`, which is
still recognised.
#### 6.1.10.3 GS1-128