[{"data":1,"prerenderedAt":702,"buildId":703},["ShallowReactive",2],{"docs-navigation-en":3,"example-\u002Fexamples\u002Fe164":30,"example-surround-\u002Fexamples\u002Fe164":611,"examples-en":621},[4],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Docs","\u002Fdocs","docs",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",{"title":14,"path":15,"stem":16},"In the browser and with frameworks","\u002Fdocs\u002Fin-the-browser","docs\u002F2.in-the-browser",{"title":18,"path":19,"stem":20},"Input rules","\u002Fdocs\u002Finput-rules","docs\u002F3.input-rules",{"title":22,"path":23,"stem":24},"Compared with libphonenumber","\u002Fdocs\u002Flibphonenumber","docs\u002F4.libphonenumber",{"title":26,"path":27,"stem":28},"Data and sources","\u002Fdocs\u002Fdata-and-sources","docs\u002F5.data-and-sources",false,{"id":31,"title":32,"body":33,"category":601,"demo":602,"description":603,"extension":604,"meta":605,"navigation":122,"order":198,"path":606,"seo":607,"stem":608,"uses":609,"__hash__":610},"examples_en\u002Fexamples\u002Fe164.md","Convert to E.164",{"type":34,"value":35,"toc":597},"minimark",[36,41,57,63,67,582,585,593],[37,38,40],"h2",{"id":39},"how-it-works","How it works",[42,43,44,48,49,52,53,56],"p",{},[45,46,47],"code",{},"international"," is the E.164 form: ",[45,50,51],{},"+81"," followed by the number without its leading ",[45,54,55],{},"0",". SMS gateways and CRMs usually require it, and libphonenumber parses it, so you can use both libraries side by side.",[42,58,59,60,62],{},"Toll-free (0120, 0800) and 0570 numbers have no international form. Their ",[45,61,47],{}," is empty.",[37,64,66],{"id":65},"in-each-language","In each language",[68,69,70,260,380],"code-group",{},[71,72,78],"pre",{"className":73,"code":74,"filename":75,"language":76,"meta":77,"style":77},"language-js shiki shiki-themes material-theme-lighter github-light github-dark","import { normalize } from \"@kurashina-design\u002Fjapan-phone\";\n\n\u002F\u002F SMS gateways and CRMs usually expect E.164. libphonenumber reads the same form.\nfor (const input of [\"090-1234-5678\", \"03-5253-8111\", \"050-3818-1250\", \"0120-123-456\"]) {\n  console.log(input, \"->\", normalize(input).international ?? \"(domestic only)\");\n}\n","Node.js","js","",[45,79,80,117,124,131,196,254],{"__ignoreMap":77},[81,82,85,89,93,97,100,103,107,111,114],"span",{"class":83,"line":84},"line",1,[81,86,88],{"class":87},"sVHd0","import",[81,90,92],{"class":91},"sP7_E"," {",[81,94,96],{"class":95},"su5hD"," normalize",[81,98,99],{"class":91}," }",[81,101,102],{"class":87}," from",[81,104,106],{"class":105},"sjJ54"," \"",[81,108,110],{"class":109},"s_sjI","@kurashina-design\u002Fjapan-phone",[81,112,113],{"class":105},"\"",[81,115,116],{"class":91},";\n",[81,118,120],{"class":83,"line":119},2,[81,121,123],{"emptyLinePlaceholder":122},true,"\n",[81,125,127],{"class":83,"line":126},3,[81,128,130],{"class":129},"sutJx","\u002F\u002F SMS gateways and CRMs usually expect E.164. libphonenumber reads the same form.\n",[81,132,134,137,140,144,148,152,155,157,160,162,165,167,170,172,174,176,179,181,183,185,188,190,193],{"class":83,"line":133},4,[81,135,136],{"class":87},"for",[81,138,139],{"class":95}," (",[81,141,143],{"class":142},"sbsja","const",[81,145,147],{"class":146},"s_hVV"," input",[81,149,151],{"class":150},"smGrS"," of",[81,153,154],{"class":95}," [",[81,156,113],{"class":105},[81,158,159],{"class":109},"090-1234-5678",[81,161,113],{"class":105},[81,163,164],{"class":91},",",[81,166,106],{"class":105},[81,168,169],{"class":109},"03-5253-8111",[81,171,113],{"class":105},[81,173,164],{"class":91},[81,175,106],{"class":105},[81,177,178],{"class":109},"050-3818-1250",[81,180,113],{"class":105},[81,182,164],{"class":91},[81,184,106],{"class":105},[81,186,187],{"class":109},"0120-123-456",[81,189,113],{"class":105},[81,191,192],{"class":95},"]) ",[81,194,195],{"class":91},"{\n",[81,197,199,202,205,209,213,216,218,220,223,225,227,229,231,233,236,238,240,243,245,248,250,252],{"class":83,"line":198},5,[81,200,201],{"class":95},"  console",[81,203,204],{"class":91},".",[81,206,208],{"class":207},"sGLFI","log",[81,210,212],{"class":211},"skxfh","(",[81,214,215],{"class":95},"input",[81,217,164],{"class":91},[81,219,106],{"class":105},[81,221,222],{"class":109},"->",[81,224,113],{"class":105},[81,226,164],{"class":91},[81,228,96],{"class":207},[81,230,212],{"class":211},[81,232,215],{"class":95},[81,234,235],{"class":211},")",[81,237,204],{"class":91},[81,239,47],{"class":95},[81,241,242],{"class":150}," ??",[81,244,106],{"class":105},[81,246,247],{"class":109},"(domestic only)",[81,249,113],{"class":105},[81,251,235],{"class":211},[81,253,116],{"class":91},[81,255,257],{"class":83,"line":256},6,[81,258,259],{"class":91},"}\n",[71,261,266],{"className":262,"code":263,"filename":264,"language":265,"meta":77,"style":77},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from japan_phone import normalize\n\n# SMS gateways and CRMs usually expect E.164. libphonenumber reads the same form.\nfor value in [\"090-1234-5678\", \"03-5253-8111\", \"050-3818-1250\", \"0120-123-456\"]:\n    print(value, \"->\", normalize(value).international or \"(domestic only)\")\n","Python","python",[45,267,268,281,285,290,335],{"__ignoreMap":77},[81,269,270,273,276,278],{"class":83,"line":84},[81,271,272],{"class":87},"from",[81,274,275],{"class":95}," japan_phone ",[81,277,88],{"class":87},[81,279,280],{"class":95}," normalize\n",[81,282,283],{"class":83,"line":119},[81,284,123],{"emptyLinePlaceholder":122},[81,286,287],{"class":83,"line":126},[81,288,289],{"class":129},"# SMS gateways and CRMs usually expect E.164. libphonenumber reads the same form.\n",[81,291,292,294,297,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332],{"class":83,"line":133},[81,293,136],{"class":87},[81,295,296],{"class":95}," value ",[81,298,299],{"class":87},"in",[81,301,154],{"class":91},[81,303,113],{"class":105},[81,305,159],{"class":109},[81,307,113],{"class":105},[81,309,164],{"class":91},[81,311,106],{"class":105},[81,313,169],{"class":109},[81,315,113],{"class":105},[81,317,164],{"class":91},[81,319,106],{"class":105},[81,321,178],{"class":109},[81,323,113],{"class":105},[81,325,164],{"class":91},[81,327,106],{"class":105},[81,329,187],{"class":109},[81,331,113],{"class":105},[81,333,334],{"class":91},"]:\n",[81,336,337,341,343,347,349,351,353,355,357,359,361,363,366,368,371,373,375,377],{"class":83,"line":198},[81,338,340],{"class":339},"sptTA","    print",[81,342,212],{"class":91},[81,344,346],{"class":345},"slqww","value",[81,348,164],{"class":91},[81,350,106],{"class":105},[81,352,222],{"class":109},[81,354,113],{"class":105},[81,356,164],{"class":91},[81,358,96],{"class":345},[81,360,212],{"class":91},[81,362,346],{"class":345},[81,364,365],{"class":91},").",[81,367,47],{"class":211},[81,369,370],{"class":87}," or",[81,372,106],{"class":105},[81,374,247],{"class":109},[81,376,113],{"class":105},[81,378,379],{"class":91},")\n",[71,381,386],{"className":382,"code":383,"filename":384,"language":385,"meta":77,"style":77},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","import jp.kurashina.japanphone.JapanPhoneNumber;\nimport jp.kurashina.japanphone.JapanPhone;\n\n\u002F\u002F SMS gateways and CRMs usually expect E.164. libphonenumber reads the same form.\nfor (String input : new String[] {\"090-1234-5678\", \"03-5253-8111\", \"050-3818-1250\", \"0120-123-456\"}) {\n  System.out.println(input + \" -> \" + JapanPhone.normalize(input).get().getInternational().orElse(\"(domestic only)\"));\n}\n","Java","java",[45,387,388,414,435,439,443,505,577],{"__ignoreMap":77},[81,389,390,393,397,399,402,404,407,409,412],{"class":83,"line":84},[81,391,88],{"class":392},"sw1J6",[81,394,396],{"class":395},"s_bVq"," jp",[81,398,204],{"class":91},[81,400,401],{"class":395},"kurashina",[81,403,204],{"class":91},[81,405,406],{"class":395},"japanphone",[81,408,204],{"class":91},[81,410,411],{"class":395},"JapanPhoneNumber",[81,413,116],{"class":91},[81,415,416,418,420,422,424,426,428,430,433],{"class":83,"line":119},[81,417,88],{"class":392},[81,419,396],{"class":395},[81,421,204],{"class":91},[81,423,401],{"class":395},[81,425,204],{"class":91},[81,427,406],{"class":395},[81,429,204],{"class":91},[81,431,432],{"class":395},"JapanPhone",[81,434,116],{"class":91},[81,436,437],{"class":83,"line":126},[81,438,123],{"emptyLinePlaceholder":122},[81,440,441],{"class":83,"line":133},[81,442,130],{"class":129},[81,444,445,447,449,452,455,458,461,464,467,469,471,473,475,477,479,481,483,485,487,489,491,493,495,497,499,502],{"class":83,"line":198},[81,446,136],{"class":87},[81,448,139],{"class":91},[81,450,451],{"class":395},"String",[81,453,454],{"class":95}," input ",[81,456,457],{"class":87},":",[81,459,460],{"class":87}," new",[81,462,463],{"class":142}," String",[81,465,466],{"class":91},"[]",[81,468,92],{"class":91},[81,470,113],{"class":105},[81,472,159],{"class":109},[81,474,113],{"class":105},[81,476,164],{"class":91},[81,478,106],{"class":105},[81,480,169],{"class":109},[81,482,113],{"class":105},[81,484,164],{"class":91},[81,486,106],{"class":105},[81,488,178],{"class":109},[81,490,113],{"class":105},[81,492,164],{"class":91},[81,494,106],{"class":105},[81,496,187],{"class":109},[81,498,113],{"class":105},[81,500,501],{"class":91},"})",[81,503,504],{"class":91}," {\n",[81,506,507,510,512,515,517,520,522,525,528,530,533,535,538,541,543,546,548,550,552,555,558,561,563,566,568,570,572,574],{"class":83,"line":256},[81,508,509],{"class":95},"  System",[81,511,204],{"class":91},[81,513,514],{"class":95},"out",[81,516,204],{"class":91},[81,518,519],{"class":207},"println",[81,521,212],{"class":91},[81,523,524],{"class":95},"input ",[81,526,527],{"class":150},"+",[81,529,106],{"class":105},[81,531,532],{"class":109}," -> ",[81,534,113],{"class":105},[81,536,537],{"class":150}," +",[81,539,540],{"class":95}," JapanPhone",[81,542,204],{"class":91},[81,544,545],{"class":207},"normalize",[81,547,212],{"class":91},[81,549,215],{"class":95},[81,551,365],{"class":91},[81,553,554],{"class":207},"get",[81,556,557],{"class":91},"().",[81,559,560],{"class":207},"getInternational",[81,562,557],{"class":91},[81,564,565],{"class":207},"orElse",[81,567,212],{"class":91},[81,569,113],{"class":105},[81,571,247],{"class":109},[81,573,113],{"class":105},[81,575,576],{"class":91},"));\n",[81,578,580],{"class":83,"line":579},7,[81,581,259],{"class":91},[42,583,584],{},"Output:",[71,586,591],{"className":587,"code":589,"language":590,"meta":77},[588],"language-text","090-1234-5678 -> +819012345678\n03-5253-8111 -> +81352538111\n050-3818-1250 -> +815038181250\n0120-123-456 -> (domestic only)\n","text",[45,592,589],{"__ignoreMap":77},[594,595,596],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":77,"searchDepth":119,"depth":119,"links":598},[599,600],{"id":39,"depth":119,"text":40},{"id":65,"depth":119,"text":66},"data","e164","Pass numbers to SMS gateways, CRMs, and libphonenumber in international form.","md",{},"\u002Fexamples\u002Fe164",{"title":32,"description":603},"examples\u002Fe164",[545,47],"oX2vOw7Q8Zqr_lrgjcokiC-2opRPMkwn_ueCOpvl9hI",[612,616],{"path":613,"title":614,"description":615,"category":601,"order":133},"\u002Fexamples\u002Ftype-stats","Count numbers by type","See how many entries are mobile, fixed-line, toll-free, or invalid.",{"path":617,"title":618,"description":619,"category":620,"order":84},"\u002Fexamples\u002Fplan-check","Reject numbers that cannot exist","Numbers missing from the numbering plan or the MIC tables are invalid.","rules",[622,629,635,642,648,655,661,668,675,681,687,690,692,696],{"path":623,"title":624,"description":625,"category":626,"order":84,"uses":627,"demo":628},"\u002Fexamples\u002Fvalidate-input","Validate a phone number field","Accept full-width input, reject numbers that do not exist, and save one notation.","forms",[545],"validate-input",{"path":630,"title":631,"description":632,"category":626,"order":119,"uses":633,"demo":634},"\u002Fexamples\u002Fpaste-labels","Accept pasted labels and notes","Take the main number from lines like ",[545],"paste-labels",{"path":636,"title":637,"description":638,"category":626,"order":126,"uses":639,"demo":641},"\u002Fexamples\u002Fmobile-only","Accept mobile numbers only","Use the type to decide whether a number can receive SMS.",[545,640],"type","mobile-only",{"path":643,"title":644,"description":645,"category":626,"order":133,"uses":646,"demo":647},"\u002Fexamples\u002Ftel-link","Make tel: links","Link numbers in their international form, and keep domestic-only numbers dialable.",[545,47],"tel-link",{"path":649,"title":650,"description":651,"category":590,"order":84,"uses":652,"demo":654},"\u002Fexamples\u002Fextract-inquiry","Find numbers in a message","Pick every phone number out of a message, in the order it appears.",[653],"extract","extract-inquiry",{"path":656,"title":657,"description":658,"category":590,"order":119,"uses":659,"demo":660},"\u002Fexamples\u002Fbusiness-card","Read a business card in kanji digits","Find numbers written with 〇一二三, as on vertical business cards.",[653],"business-card",{"path":662,"title":663,"description":664,"category":590,"order":126,"uses":665,"demo":667},"\u002Fexamples\u002Fcompany-page","List the numbers on a company page","Find TEL and FAX numbers and drop duplicates written in other notations.",[653,666],"digits","company-page",{"path":669,"title":670,"description":671,"category":601,"order":84,"uses":672,"demo":674},"\u002Fexamples\u002Fdisplay-format","Store digits, show hyphens","Format stored digits with the groups from the numbering table.",[545,673],"national","display-format",{"path":676,"title":677,"description":678,"category":601,"order":119,"uses":679,"demo":680},"\u002Fexamples\u002Fdedupe","Find duplicates written differently","Group entries that are the same number in different notations.",[545],"dedupe",{"path":682,"title":683,"description":684,"category":601,"order":126,"uses":685,"demo":686},"\u002Fexamples\u002Fcsv-cleanup","Clean a CSV column","Rewrite a phone column in one notation and flag rows that need a person.",[545],"csv-cleanup",{"path":613,"title":614,"description":615,"category":601,"order":133,"uses":688,"demo":689},[545,640],"type-stats",{"path":606,"title":32,"description":603,"category":601,"order":198,"uses":691,"demo":602},[545,47],{"path":617,"title":618,"description":619,"category":620,"order":84,"uses":693,"demo":695},[694],"isValid","plan-check",{"path":697,"title":698,"description":699,"category":620,"order":119,"uses":700,"demo":701},"\u002Fexamples\u002Finternational-input","Read numbers written for abroad","Accept +81 notation, including the bracketed (0), for the types that can be dialed from abroad.",[545],"international-input",1796483608056,"73e0e014-4aa7-4f04-8db5-5f7391793162"]