File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
OpenHardwareMonitorLib/Hardware Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,28 @@ private static void CoerceIdentifiers(string[] identifiers)
8989 for ( int i = 0 ; i < identifiers . Length ; i ++ )
9090 {
9191 string s = identifiers [ i ] ;
92- identifiers [ i ] = Uri . EscapeDataString ( identifiers [ i ] ) ;
92+ if ( string . IsNullOrEmpty ( s ) )
93+ continue ;
94+
95+ var sb = new StringBuilder ( s . Length ) ;
96+ foreach ( char c in s )
97+ {
98+ if ( IsUnreserved ( c ) )
99+ sb . Append ( c ) ;
100+ }
101+ identifiers [ i ] = sb . ToString ( ) ;
93102 }
94103 }
95104
105+ private static bool IsUnreserved ( char c )
106+ {
107+ return
108+ ( c >= 'A' && c <= 'Z' ) ||
109+ ( c >= 'a' && c <= 'z' ) ||
110+ ( c >= '0' && c <= '9' ) ||
111+ c == '-' || c == '_' ; // || c == '.' || c == '~';
112+ }
113+
96114 /// <inheritdoc />
97115 public override string ToString ( )
98116 {
You can’t perform that action at this time.
0 commit comments