Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.14 KB

formatJapaneseUnicode.md

File metadata and controls

53 lines (38 loc) · 1.14 KB

piupiu.formatJapaneseUnicode(input)

Return a snake-cased input.

Source

Description

Japanese unicode can introduce some error, especially if you work with string and parsing.

For instance, string-numbers can appear exactly similar but aren't: this are totally different unicode codes:

//Japanese number Unicode
"0123456789"

//Universal number Unicode:
"0123456789"

You can see that != 0 and also that any characters have some "left and right spaces".

The main goal of this function is to transform any Japanese unicode 0123456789 to 0123456789

Since

0.1.0

Arguments

input (string)

Returns

(string): Returns classic unicode number

Example

piupiu.formatJapaneseUnicode('0'); 
// '0'
piupiu.formatJapaneseUnicode("1992年10月26日"); 
// '1992年10月26日'
piupiu.formatJapaneseUnicode('ToTo'); 
// 'ToTo'
piupiu.formatJapaneseUnicode(null); 
// undefined