|
11 | 11 | let return = |
12 | 12 | List.Transform( columnNames, ( curName ) => [ |
13 | 13 | HasWhitespace = RawName <> Text.Trim( curName ), |
14 | | - RawName = curName, |
15 | | - Symbols = Text.FormatControlSymbols( curName ), |
16 | | - HexSummary = "Hex: " & Text.Combine( AsHexStr, ", " ), |
17 | | - DecSummary = "Dec: " & Text.Combine( |
18 | | - List.Transform( Codepoints, each Text.From(_) ), |
19 | | - ", " ), |
| 14 | + RawName = curName, |
| 15 | + Symbols = Text.FormatControlSymbols( curName ), |
| 16 | + HexSummary = "Hex: " & Text.Combine( AsHexStr, ", " ), |
| 17 | + DecSummary = "Dec: " & Text.Combine( List.Transform( Codepoints, each Text.From(_)), ", " ), |
20 | 18 |
|
21 | 19 | CharList = Text.ToList( RawName ), |
22 | 20 | Codepoints = List.Transform( CharList, each Character.ToNumber( _ ) ), |
|
54 | 52 | newChar = |
55 | 53 | if codepoint <= 0x20 |
56 | 54 | then Character.FromNumber( codepoint + 0x2400 ) |
| 55 | + else if codepoint = 0x200d then "<ZWJ>" |
57 | 56 | else char |
58 | 57 | ][newChar] |
59 | 58 | ), |
|
64 | 63 |
|
65 | 64 |
|
66 | 65 | raw_names = Table.ColumnNames( Source ), |
67 | | - inspected = InspectInvisibleText( raw_names ), |
68 | | - |
69 | | - /* bonus section: |
70 | | - you can use codepoints in powerquery strings, as literals |
71 | | - It uses hex notation. |
72 | | - |
73 | | - Note: It requires either 4-digits or 8-digits. So "20" has to be "0020" or "00000020" |
74 | | - */ |
75 | | - |
76 | | - |
| 66 | + raw_names_extra = { |
| 67 | + " User(cr,lf) Names", |
| 68 | + " Has#(tab) tabs ", |
| 69 | + "#(0020) Zero-Width #(200d) Joiner Inside", |
| 70 | + Character.FromNumber(0x1b), |
| 71 | + "Escape #(001b) Sequence" |
| 72 | + }, |
| 73 | + |
| 74 | + inspected_columns = InspectInvisibleText( raw_names ), // from enter-data |
| 75 | + inspected = InspectInvisibleText( raw_names_extra ),// inline strings for even more special chars |
| 76 | + |
| 77 | + // You can use codepoints in strings using the hex notation |
77 | 78 | ExampleCodepointsInPQ = [ |
78 | | - RawStr = " ", |
79 | | - AsInline = "#(0020)", |
80 | | - AsCodepoint = Character.FromNumber( 32 ), |
| 79 | + RawStr = " ", |
| 80 | + AsInline = "#(0020)", |
| 81 | + AsCodepoint = Character.FromNumber( 32 ), |
81 | 82 | AsCodepointFromHex = Character.FromNumber( 0x20 ), |
82 | 83 |
|
83 | 84 | // test that shows they builds the exactly identical string: |
|
0 commit comments