1
1
using System ;
2
+ using System . Globalization ;
2
3
using System . Text ;
3
4
using System . Text . RegularExpressions ;
4
5
@@ -19,8 +20,8 @@ public class AutokeyEncorder
19
20
/// <returns>The Autokey encoded string (All Uppercase).</returns>
20
21
public string Encode ( string plainText , string keyword )
21
22
{
22
- plainText = Regex . Replace ( plainText . ToUpper ( ) , "[^A-Z]" , string . Empty ) ;
23
- keyword = keyword . ToUpper ( ) ;
23
+ plainText = Regex . Replace ( plainText . ToUpper ( CultureInfo . InvariantCulture ) , "[^A-Z]" , string . Empty ) ;
24
+ keyword = keyword . ToUpper ( CultureInfo . InvariantCulture ) ;
24
25
25
26
keyword += plainText ;
26
27
@@ -46,8 +47,8 @@ public string Encode(string plainText, string keyword)
46
47
/// <returns>The plaintext (All Uppercase).</returns>
47
48
public string Decode ( string cipherText , string keyword )
48
49
{
49
- cipherText = Regex . Replace ( cipherText . ToUpper ( ) , "[^A-Z]" , string . Empty ) ;
50
- keyword = keyword . ToUpper ( ) ;
50
+ cipherText = Regex . Replace ( cipherText . ToUpper ( CultureInfo . InvariantCulture ) , "[^A-Z]" , string . Empty ) ;
51
+ keyword = keyword . ToUpper ( CultureInfo . InvariantCulture ) ;
51
52
52
53
StringBuilder plainText = new StringBuilder ( ) ;
53
54
StringBuilder extendedKeyword = new StringBuilder ( keyword ) ;
0 commit comments