
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
fullwidth-quotes
Advanced tools
Convert CJK quotation marks to fullwidth according to Unicode Standardized Variation Sequence (SVS)
Convert CJK quotation marks to fullwidth according to Unicode Standardized Variation Sequence (SVS).
In Unicode 16.0, it supports fullwidth quotation marks with variation selectors.
| Character | Unicode | Name |
|---|---|---|
| “︀ | U+201C U+FE00 | Halfwidth Left Double Quotation Mark |
| ”︀ | U+201D U+FE00 | Halfwidth Right Double Quotation Mark |
| ‘︀ | U+2018 U+FE00 | Halfwidth Left Single Quotation Mark |
| ’︀ | U+2019 U+FE00 | Halfwidth Right Single Quotation Mark |
| “︁ | U+201C U+FE01 | Fullwidth Left Double Quotation Mark |
| ”︁ | U+201D U+FE01 | Fullwidth Right Double Quotation Mark |
| ‘︁ | U+2018 U+FE01 | Fullwidth Left Single Quotation Mark |
| ’︁ | U+2019 U+FE01 | Fullwidth Right Single Quotation Mark |
This library will help you to add variant selectors for quotation marks automatically.
It only effects on smart quotation marks (curly quotation marks) and will not have any effects on dumb quotation marks (straight quotation marks).
This requires font support, otherwise you won't be able to see the difference between the two.
# npm
npm install fullwidth-quotes
# yarn
yarn add fullwidth-quotes
# pnpm
pnpm add fullwidth-quotes
import { enableSvsQuotes } from "fullwidth-quotes";
enableSvsQuotes("“Hello world!”"); // Add U+FE00 after the `“` and `”` characters.
enableSvsQuotes("“Hello world!”", "zh-CN"); // Convert only Chinese and Japanese to fullwidth quotes.
import { LEFT_DOUBLE_QUOTE_FULLWIDTH, RIGHT_DOUBLE_QUOTE_FULLWIDTH } from "fullwidth-quotes/chars";
// You can also directly get the samples of these characters.
enableSvsQuotesConvert CJK quotation marks to fullwidth according to Unicode Standardized Variation Sequence (SVS).
If quotation marks enclose the context of Chinese or Japanese (excluding Korean), then switch them to fullwidth.
If the second parameter locale is provided, the quotation marks will only be converted to fullwidth when the script
of the locale is "Hani", "Hans", "Hant", or "Jpan".
disableSvsQuotesRemove the variation selectors from all quotation marks to restore them to ambiguous pure characters.
alwaysToFullwidthQuotes (Not Recommended)Always convert all quotation marks in the string to fullwidth, regardless of the context character.
In the parameters, you can decide whether to ignore and replace any variation selector if a quotation mark already contain it.
alwaysToHalfwidthQuotes (Not Recommended)Always convert all quotation marks in the string to halfwidth, regardless of the context character.
In the parameters, you can decide whether to ignore and replace any variation selector if a quotation mark already contain it.
shouldFullwidthDetermine whether a string should be enclosed in fullwidth brackets or quotation marks.
Determine rules:
isFullwidthCheck if a character is fullwidth. But treat hangul as halfwidth due to korean uses halfwidth punctuation marks, and treat empty string as ambiguous.
| East Asian Width | Returns |
|---|---|
| fullwidth | true |
| halfwidth | false |
| wide | true |
| narrow | false |
| neutral | false |
| ambiguous | null |
| Special | Returns |
|---|---|
| Quote + VS1 | false |
| Quote + VS2 | true |
| Hangul | false |
| Empty String | null |
toUnicodeStringSequenceConvert a string to Unicode sequence that won't divide the variation selectors or something else into single characters.
It will return an array where each element is a valid Unicode Variation Sequences.
fullwidth-quotes is available under the MIT License. See the LICENSE file for more info.
FAQs
Convert CJK quotation marks to fullwidth according to Unicode Standardized Variation Sequence (SVS)
We found that fullwidth-quotes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.