StringBuilder adds Persian numbers

I am trying to add some numbers to a string, this string already contains a Persian character, and StringBuilderalways adds a Persian number to the string.

    StringBuilder sb = new StringBuilder();
    sb.Append( other things );
    sb.Append("', '");
    sb.Append("1234234");
    sb.Append("', ");

Even when I explicitly use English numbers like the ones above, I still get Persian numbers. How to add English numbers to this line?

UPDATE

These lines simulate my problem, you can see the Persian number by following this code:

     StringBuilder temp = new StringBuilder();
                    temp.Append("INSERT INTO [db] (....) VALUES ('21211221', 111555, 
                                '2015/12/12', 'نام خانوادگی  ', 'اتاق چهار تخته");
                temp.Append("', '");
                temp.Append("234234");

The last extension must be English, but it is not.

+4
source share
1 answer

-, . Windows RTL. , LTR. Unicode "U + 200E" .

StringBuilder temp = new StringBuilder();
temp.Append("INSERT INTO [db] (....) VALUES ('21211221', 111555, '2015/12/12', 'نام خانوادگی  ', 'اتاق چهار تخته");
temp.Append('\x200E');
temp.Append("', '");
temp.Append("234234");

LTR:

INSERT INTO [db] (....) VALUES ('21211221', 111555, '2015/12/12', 'نام خانوادگی ', 'اتاق چهار تخته', '234234

LTR:

INSERT INTO [db] (....) VALUES ('21211221', 111555, '2015/12/12', 'نام خانوادگی ', 'اتاق چهار تخته‎', '234234
+7

All Articles