google-libphonenumber 3.2.3 → 3.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -272,6 +272,33 @@ If you're looking for a slightly simpler API, you should try [awesome-phonenumbe
272
272
 
273
273
  There have been some users reporting successful but also unsuccessful usage with Webpack. While I don't personally use it, I'm 100% supportive of pull requests adding modifications that allow this package to better interact with it.
274
274
 
275
+ ### Chrome Extensions
276
+
277
+ Google Closure Compiler API, a serviced provided by Google to compile code online via its Closure library, may not always return fully compliant UTF-8-encoded output.
278
+
279
+ Loading extensions using this library on Google Chrome and other Chromium-based browsers may result in the following error when compiled with webpack:
280
+
281
+ `Could not load file 'file.js' for content script. It isn't UTF-8 encoded.`
282
+
283
+ While the local Java-based version supports a parameter which would let us workaround this issue at the source using `--charset=US-ASCII`, the online API version, which is a lot more convenient to use, does not offer support for an equivalent parameter (e.g. `output_charset=US-ASCII`).
284
+
285
+ In order to workaround this issue when using webpack, make sure to output US-ASCII characters only when defining `TerserPlugin` options, as demonstrated below:
286
+
287
+ ```js
288
+ optimization: {
289
+ minimize: process.env.NODE_ENV !== 'development',
290
+ minimizer: [
291
+ new TerserPlugin({
292
+ terserOptions: {
293
+ output: {
294
+ ascii_only: true
295
+ }
296
+ },
297
+ }),
298
+ ]
299
+ }
300
+ ```
301
+
275
302
  ## Tests
276
303
 
277
304
  A small subset of tests guarantees that the main library functions are working as expected and are correctly exported. The actual heavy lifting is done by `libphonenumber`'s extensive test suite.