webpack-contrib / json-loader

json loader module for webpack - UNMAINTAINED

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Escaped unicode code points being mangled

altano opened this issue · comments

commented

When I run this json through the json-loader:

https://github.com/fb55/htmlparser2/blob/master/lib/entities/entities.json

I get:

63: function(module) {
    module.exports = {
        quot: 34,
        amp: 38,
        apos: 39,
        lpar: 40,
        rpar: 41,
        lt: 60,
        gt: 62,
        nbsp: 160,
        iexcl: 161
        ...
    }
}

It looks like the escaped unicode code points are being lost. I'm not exactly sure what the resulting values are, but it is neither the unescaped unicode characters nor the escaped code point sequences.

It's interesting that quot became "34" instead of just """, which is technically the correct ASCII value, but the json-loader should not be doing such conversions.

This doesn't occur for me:

function(module, exports, __webpack_require__) {
    module.exports = {
        "Aacute": "Á",
        "aacute": "á",
        "Abreve": "Ă",
        "abreve": "ă",
        "ac": "∾",
        "acd": "∿",
        "acE": "∾̳",
        ...
        "quot": "\"",
        ...
function(r){r.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",...,quot:'"',...

any update to this?

commented

Hmmm, I tried creating a minimal-repro of this issue and it just wouldn't reproduce. I'll close for now, and when I get back to working on my main project later I'll re-open the issue if I can figure out how to recreate it.

Thanks for taking a look.