Function Repository Resource:

DecodeFromIDNA

Source Notebook

Decode an IDNA string

Contributed by: Arnoud Buzing

ResourceFunction["DecodeFromIDNA"][string]

decodes an IDNA formatted string.

Examples

Basic Examples

Decode a string from the IDNA format:

In[1]:=
ResourceFunction["DecodeFromIDNA"]["xn--eckwd4c7c.xn--zckzah"]
Out[1]=

Encode a Unicode string:

In[2]:=
session = StartExternalSession["Python"];
someidna = ResourceFunction["EncodeToIDNA"][session, "ⱎⷕⴇ"]
Out[3]=

Decode it:

In[4]:=
ResourceFunction[<|"SymbolName" -> "FunctionRepository`$95199ddd02c1404aa6d7f4422e6cd336`DecodeFromIDNA", "UUID" -> "ec25fe3a-a0d2-4bfe-ae83-2abc654c10cb", "ResourceType" -> "Function", "Name" -> InterpretationBox[
TagBox[
TagBox[
DynamicModuleBox[{Typeset`open = False}, 
FrameBox[
PaneSelectorBox[{False -> GridBox[{{
PaneBox[
GridBox[{{
AdjustmentBox[
StyleBox[
StyleBox[
StyleBox[
                    "\"[\[FilledSmallSquare]]\"", FontColor -> RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], "ResourceFunctionIcon"], FontFamily -> "Source Sans Pro Black", FontWeight -> "Heavy", PrivateFontOptions -> {"OperatorSubstitution" -> False}, FontSize -> 0.6538461538461539 Inherited, ShowStringCharacters -> False], BoxBaselineShift -> -0.25, BoxMargins -> {{0, 0}, {-1, -1}}], 
StyleBox[
RowBox[{
StyleBox[
                    "DecodeFromIDNA", "ResourceFunctionLabel", FontFamily -> "Source Sans Pro"], " "}], FontColor -> GrayLevel[0.1], FontSize -> Rational[12, 13] Inherited, ShowStringCharacters -> False, ShowAutoStyles -> False]}}, GridBoxSpacings -> {"Columns" -> {{0.25}}}], Alignment -> Left, FrameMargins -> {{3, 0}, {0, 0}}, BaselinePosition -> Baseline, BaseStyle -> {LineSpacing -> {0, 0}, LineBreakWithin -> False}], 
ItemBox[
PaneBox[
TogglerBox[
Dynamic[Typeset`open], {True -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]}, BaselinePosition -> Baseline, Appearance -> None, ContentPadding -> False, FrameMargins -> 0], Alignment -> Left, FrameMargins -> {{1, 1}, {0, 0}}, BaselinePosition -> Baseline], Frame -> {{
RGBColor[
                   0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {{0}}, "Rows" -> {{0}}},
              BaselinePosition -> {1, 1}], True -> GridBox[{{
GridBox[{{
PaneBox[
GridBox[{{
AdjustmentBox[
StyleBox[
StyleBox[
StyleBox[
                    "\"[\[FilledSmallSquare]]\"", FontColor -> RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], "ResourceFunctionIcon"], FontFamily -> "Source Sans Pro Black", FontWeight -> "Heavy", PrivateFontOptions -> {"OperatorSubstitution" -> False}, FontSize -> 0.6538461538461539 Inherited, ShowStringCharacters -> False], BoxBaselineShift -> -0.25, BoxMargins -> {{0, 0}, {-1, -1}}], 
StyleBox[
RowBox[{
StyleBox[
                    "DecodeFromIDNA", "ResourceFunctionLabel", FontFamily -> "Source Sans Pro"], " "}], FontColor -> GrayLevel[0.1], FontSize -> Rational[12, 13] Inherited, ShowStringCharacters -> False, ShowAutoStyles -> False]}}, GridBoxSpacings -> {"Columns" -> {{0.25}}}], Alignment -> Left, FrameMargins -> {{3, 0}, {0, 0}}, BaselinePosition -> Baseline, BaseStyle -> {LineSpacing -> {0, 0}, LineBreakWithin -> False}], 
ItemBox[
PaneBox[
TogglerBox[
Dynamic[Typeset`open], {True -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]}, BaselinePosition -> Baseline, Appearance -> None, ContentPadding -> False, FrameMargins -> 0], Alignment -> Left, FrameMargins -> {{1, 1}, {0, 0}}, BaselinePosition -> Baseline], Frame -> {{
RGBColor[
                    0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {{0}}, "Rows" -> {{0}}}, BaselinePosition -> {1, 1}]}, {
StyleBox[
PaneBox[
GridBox[{{
RowBox[{
TagBox["\"Version (latest): \"", "IconizedLabel"], " ", 
TagBox["\"1.0.0\"", "IconizedItem"]}]}, {
TagBox[
TemplateBox[{"\"Documentation »\"", "https://resources.wolframcloud.com/FunctionRepository/resources/d549f79e-a8cb-473a-87b1-3bf9b5154299/"}, "HyperlinkURL"], "IconizedItem"]}}, GridBoxAlignment -> {"Columns" -> {{Left}}}, DefaultBaseStyle -> "Column", GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment -> Left, FrameMargins -> {{5, 4}, {0, 4}}, BaselinePosition -> Baseline], "DialogStyle", FontFamily -> "Roboto", FontSize -> 11]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, BaselinePosition -> {1, 1}, GridBoxDividers -> {"Columns" -> {{None}}, "Rows" -> {False, {
GrayLevel[0.8]}, False}}]}, 
Dynamic[Typeset`open], BaselinePosition -> Baseline, ImageSize -> Automatic], BaselinePosition -> Baseline, FrameMargins -> {{0, 0}, {1, 0}}, FrameStyle -> RGBColor[
          0.8313725490196079, 0.8470588235294118, 0.8509803921568627],
          Background -> RGBColor[
          0.9686274509803922, 0.9764705882352941, 0.984313725490196], RoundingRadius -> 4, DefaultBaseStyle -> {}]], #& , TagBoxNote -> " "], {"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
        "DecodeFromIDNA"}, TagBoxNote -> "FunctionResourceBox"], 
ResourceFunction["DecodeFromIDNA"], BoxID -> "DecodeFromIDNA", Selectable -> False], "ShortName" -> InterpretationBox[
TagBox[
TagBox[
DynamicModuleBox[{Typeset`open = False}, 
FrameBox[
PaneSelectorBox[{False -> GridBox[{{
PaneBox[
GridBox[{{
AdjustmentBox[
StyleBox[
StyleBox[
StyleBox[
                    "\"[\[FilledSmallSquare]]\"", FontColor -> RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], "ResourceFunctionIcon"], FontFamily -> "Source Sans Pro Black", FontWeight -> "Heavy", PrivateFontOptions -> {"OperatorSubstitution" -> False}, FontSize -> 0.6538461538461539 Inherited, ShowStringCharacters -> False], BoxBaselineShift -> -0.25, BoxMargins -> {{0, 0}, {-1, -1}}], 
StyleBox[
RowBox[{
StyleBox[
                    "DecodeFromIDNA", "ResourceFunctionLabel", FontFamily -> "Source Sans Pro"], " "}], FontColor -> GrayLevel[0.1], FontSize -> Rational[12, 13] Inherited, ShowStringCharacters -> False, ShowAutoStyles -> False]}}, GridBoxSpacings -> {"Columns" -> {{0.25}}}], Alignment -> Left, FrameMargins -> {{3, 0}, {0, 0}}, BaselinePosition -> Baseline, BaseStyle -> {LineSpacing -> {0, 0}, LineBreakWithin -> False}], 
ItemBox[
PaneBox[
TogglerBox[
Dynamic[Typeset`open], {True -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]}, BaselinePosition -> Baseline, Appearance -> None, ContentPadding -> False, FrameMargins -> 0], Alignment -> Left, FrameMargins -> {{1, 1}, {0, 0}}, BaselinePosition -> Baseline], Frame -> {{
RGBColor[
                   0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {{0}}, "Rows" -> {{0}}},
              BaselinePosition -> {1, 1}], True -> GridBox[{{
GridBox[{{
PaneBox[
GridBox[{{
AdjustmentBox[
StyleBox[
StyleBox[
StyleBox[
                    "\"[\[FilledSmallSquare]]\"", FontColor -> RGBColor[
                    0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], "ResourceFunctionIcon"], FontFamily -> "Source Sans Pro Black", FontWeight -> "Heavy", PrivateFontOptions -> {"OperatorSubstitution" -> False}, FontSize -> 0.6538461538461539 Inherited, ShowStringCharacters -> False], BoxBaselineShift -> -0.25, BoxMargins -> {{0, 0}, {-1, -1}}], 
StyleBox[
RowBox[{
StyleBox[
                    "DecodeFromIDNA", "ResourceFunctionLabel", FontFamily -> "Source Sans Pro"], " "}], FontColor -> GrayLevel[0.1], FontSize -> Rational[12, 13] Inherited, ShowStringCharacters -> False, ShowAutoStyles -> False]}}, GridBoxSpacings -> {"Columns" -> {{0.25}}}], Alignment -> Left, FrameMargins -> {{3, 0}, {0, 0}}, BaselinePosition -> Baseline, BaseStyle -> {LineSpacing -> {0, 0}, LineBreakWithin -> False}], 
ItemBox[
PaneBox[
TogglerBox[
Dynamic[Typeset`open], {True -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeCloser"]], False -> DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps", "IconizeOpener"]]}, BaselinePosition -> Baseline, Appearance -> None, ContentPadding -> False, FrameMargins -> 0], Alignment -> Left, FrameMargins -> {{1, 1}, {0, 0}}, BaselinePosition -> Baseline], Frame -> {{
RGBColor[
                    0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {{0}}, "Rows" -> {{0}}}, BaselinePosition -> {1, 1}]}, {
StyleBox[
PaneBox[
GridBox[{{
RowBox[{
TagBox["\"Version (latest): \"", "IconizedLabel"], " ", 
TagBox["\"1.0.0\"", "IconizedItem"]}]}, {
TagBox[
TemplateBox[{"\"Documentation »\"", "https://resources.wolframcloud.com/FunctionRepository/resources/d549f79e-a8cb-473a-87b1-3bf9b5154299/"}, "HyperlinkURL"], "IconizedItem"]}}, GridBoxAlignment -> {"Columns" -> {{Left}}}, DefaultBaseStyle -> "Column", GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment -> Left, FrameMargins -> {{5, 4}, {0, 4}}, BaselinePosition -> Baseline], "DialogStyle", FontFamily -> "Roboto", FontSize -> 11]}}, GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, BaselinePosition -> {1, 1}, GridBoxDividers -> {"Columns" -> {{None}}, "Rows" -> {False, {
GrayLevel[0.8]}, False}}]}, 
Dynamic[Typeset`open], BaselinePosition -> Baseline, ImageSize -> Automatic], BaselinePosition -> Baseline, FrameMargins -> {{0, 0}, {1, 0}}, FrameStyle -> RGBColor[
          0.8313725490196079, 0.8470588235294118, 0.8509803921568627],
          Background -> RGBColor[
          0.9686274509803922, 0.9764705882352941, 0.984313725490196], RoundingRadius -> 4, DefaultBaseStyle -> {}]], #& , TagBoxNote -> " "], {"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
        "DecodeFromIDNA"}, TagBoxNote -> "FunctionResourceBox"], 
ResourceFunction["DecodeFromIDNA"], BoxID -> "DecodeFromIDNA", Selectable -> False], "Description" -> "Decode an IDNA string", "FunctionLocation" -> CloudObject[
    "https://www.wolframcloud.com/obj/resourcesystem/marketplacestorage/submissions/4d052d0bc026e682/d7e/d7ef9367-083d-468d-90fa-499a101225e2/159c4f70b635db4f/data"]|>][someidna]
Out[4]=

Publisher

Arnoud Buzing

Version History

  • 2.0.0 – 06 November 2024
  • 1.0.0 – 08 July 2019

Related Resources

License Information