<commit_before># svg-url-loader
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]

Converts SVG file to utf-8 encoded data-uri string.

Existing [`url-loader`](https://github.com/webpack/url-loader) always does Base64 encoding for data-uri.  As SVG content is a human-readable xml string, using base64 encoding is not mandatory.  Instead, one may only escape [unsafe characters](http://www.ietf.org/rfc/rfc1738.txt) and replace `"` with `'` as described [in this article](http://codepen.io/Tigt/post/optimizing-svgs-in-data-uris).  

There are some benefits for choosing utf-8 encoding over base64.  
1. Resulting string is shorter (can be ~2 times shorter for 2K-sized icons);  
2. Resulting string will be compressed better when using gzip compression;  
3. Browser parses utf-8 encoded string faster than its base64 equivalent.


## Usage
<commit_msg>chore. minor fix in readme<commit_after># svg-url-loader
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]

A webpack loader which loads SVG file as utf-8 encoded DataUrl string.

Existing [`url-loader`](https://github.com/webpack/url-loader) always does Base64 encoding for data-uri.  As SVG content is a human-readable xml string, using base64 encoding is not mandatory.  Instead, one may only escape [unsafe characters](http://www.ietf.org/rfc/rfc1738.txt) and replace `"` with `'` as described [in this article](http://codepen.io/Tigt/post/optimizing-svgs-in-data-uris).  

There are some benefits for choosing utf-8 encoding over base64.  
1. Resulting string is shorter (can be ~2 times shorter for 2K-sized icons);  
2. Resulting string will be compressed better when using gzip compression;  
3. Browser parses utf-8 encoded string faster than its base64 equivalent.


## Usage

{'fraction_non_alphanumeric': 0.12362911266201396, 'fraction_numerical': 0.019940179461615155, 'mean_word_length': 4.717948717948718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '154877', 'n_tokens_mistral': 653, 'n_tokens_neox': 620, 'n_words': 210}