Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !9982

Fix for #9925: Convert font data to BASE64, fixing 0xEFBFBD (Unicode Replacement Character) chars in customizer fonts.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/hero-m/encode-fonts into master Aug 21, 2013
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 4

Created by: hero-m

First 16 bytes in original glyphicons-halflings-regular.ttf

0000000: 0001 0000 000f 00[80] 0003 0070 4646 544d

First 16 bytes in customizer version:

0000000: 0001 0000 000f 00[ef bfbd] 0003 0070 4646

This is caused by the 'utf8' encoding in fs.readFileSync function, which replaces any unknown unicode chars with the "EF BF BD" character (all throughout the font data).

The actual fix comes from this line:

      return type == 'fonts' ? files[path] = fs.readFileSync(type + '/' + path) :
          files[path] = fs.readFileSync(type + '/' + path, 'utf8')

But the btoa function decreases the raw-files.js by 200kB, so I let it stay.

[Fixes #9925 (closed)]

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/hero-m/encode-fonts