View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001964 | Far Manager | Viewer | public | 2011-12-29 06:03 | 2012-05-17 10:06 |
| Reporter | sbaftal | Assigned To | 2useven10 | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | windows | OS | xp | OS Version | sp3 |
| Product Version | 2.0 | ||||
| Fixed in Version | 3.0 | ||||
| Summary | 0001964: Viewer не находит текст в UTF8 файле | ||||
| Description | есть файл Visual Studio 2008 1.txt (Service1.asmx.cs) в UTF8 В нем есть символы TCP. Если эти символы расположены далее позиции 8190, то viewer их не находит Повторяется на xp и win7 100% | ||||
| Steps To Reproduce | если убрать 1 пробел перед TCP - то ищет если добавить - не ищет | ||||
| Additional Information | если при открытии файла сдвинуться чуть-чуть вниз - все находит | ||||
| Tags | No tags attached. | ||||
| Build | 2350 | ||||
|
|
1.txt (8,303 bytes)
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.Odbc;
using Oracle.DataAccess.Client;
using System.Net.Sockets;
using System.Net;
using System.Text;
using System.Xml;
using System.IO;
using System.Configuration;
namespace webservice2
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "cardauth2")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
[WebMethod]
//******************************* auth_request ***********************************************
public auth_response auth_request(
string source,
string xref,
string reqdatetime,
string card,
string card_desc,
string sum,
string ccy,
string summin,
string partial,
string ignorecardstatus
)
{
string xml_in="", xml_out="", sql="", strlog="";
string i002 = "", i037 = "", i038 = "", i039 = "";
string cardnumber="", expirydate="", cardserno="";
string card_otb="", card_cur="", card_status="";
decimal rate = 0, sum_otb_dec = 0;
auth_response result = new auth_response();
auth_in req = new auth_in();
req.source = source;
req.xref = xref;
req.reqdatetime = reqdatetime;
req.card = card;
req.card_desc = card_desc;
req.sum = sum;
req.ccy = ccy;
if (!GLOBAL_INIT()) { result.respdesc = GLOBAL.ERROR; return result; };
//System.Threading.Thread.Sleep(125000);
// default values
if (summin == null || summin.Trim() == "") summin = "0";
if (partial == null || partial.Trim() == "") partial = "N";
if (ignorecardstatus == null || ignorecardstatus.Trim() == "") ignorecardstatus = "Y";
write_log("");
write_log("********** new message authorization ****************");
result.xref = xref;
result.reqid = "-";
result.respcode = "01";
result.respdesc = "unexpected result due to internal error";
result.authid = "-";
result.sum = "0"; // sum;
result.card_ccy_sum = "0"; // sum;
result.card_ccy = "-";
result.rate = "-";
// auth Informix ************************
OdbcDataReader inf_Reader;
OdbcConnection inf_con = new OdbcConnection(GLOBAL.ONLINE);
OdbcCommand inf_cmd = inf_con.CreateCommand();
try
{
inf_con.Open();
sql = "set isolation dirty read";
inf_cmd.CommandText = sql; inf_cmd.ExecuteNonQuery();
}
catch (OdbcException ex)
{
write_log(ex.Message);
result.respdesc = "01 " + ex.Message;
return result;
}
// auth Informix ************************
strlog = "source=" + source;
strlog+= "; xref=" + xref;
strlog+= "; reqdt=" + reqdatetime;
strlog+= "; card=" + card;
strlog+= "; card_desc=" + card_desc;
strlog+= "; sum=" + sum;
strlog+= "; ccy=" + ccy;
strlog+= "; summin=" + summin;
strlog+= "; partial=" + partial;
strlog+= "; ics=" + ignorecardstatus;
write_log(strlog);
write_sql_log("auth1", req,result);
// auth check params ************************
if (ccy == "810") ccy = "643";
if (!(ccy == "643" || ccy == "840" || ccy == "978" ))
{ result.respdesc = "01 currency not supported"; write_sql_log("auth3", req,result); return result;}
decimal sum_dec, card_otb_dec, summin_dec; string sum_ctl;
if (!decimal.TryParse(sum, out sum_dec))
{ result.respdesc = "01 error in sum"; write_sql_log("auth3", req, result); return result;}
if (sum_dec == 0) { result.respdesc = "01 error: sum=0"; write_sql_log("auth3", req, result); return result; }
if (!decimal.TryParse(summin, out summin_dec))
{ result.respdesc = "01 error in summin"; write_sql_log("auth3", req, result); return result; }
sql = "select number, to_char(expirydate,'%y%m'), serno, " +
"sbaf_get_otb(number), authcurrency, stauthorization from cards " +
"where number=web_getcard2('" + card + "','"+card_desc+"')";
inf_cmd.CommandText = sql; //write_log(sql);
inf_Reader = inf_cmd.ExecuteReader();
if (inf_Reader.Read())
{
cardnumber = inf_Reader.GetString(0).Trim();
expirydate = inf_Reader.GetString(1).Trim();
cardserno = inf_Reader.GetString(2).Trim();
card_otb = inf_Reader.GetString(3).Trim();
card_cur = inf_Reader.GetString(4).Trim();
card_status= inf_Reader.GetString(5).Trim();
}
inf_Reader.Close();
result.card_ccy = card_cur;
strlog += "; card=" + cardnumber;
strlog += "; exp=" + expirydate;
strlog += "; otb=" + card_otb;
req.cardnumber = cardnumber; req.exp = expirydate; req.otb = card_otb;
// write_sql_log("auth2", strlog, req, result);
write_log("card=" + cardnumber + " exp=" + expirydate + " otb=" + card_otb + " cur=" + card_cur);
if (cardnumber == "" || expirydate == "")
{ result.respdesc = "01 invalid card"; write_sql_log("auth3", req, result); return result; }
if (!decimal.TryParse(card_otb, out card_otb_dec))
{ result.respdesc = "01 error in online otb"; write_sql_log("auth3", req, result); return result; }
// ************ for conversion start **********
if (ccy != card_cur)
{ // result.respdesc = "01 currency not equal to card currency"; write_sql_log("auth3", req, result); return result;
sql = "select first 1 rate from exratesdirect where" +
" fromcurrency='" + ccy + "'" +
" and tocurrency='" + card_cur + "'" +
" order by timestamp desc";
inf_cmd.CommandText = sql; //write_log(sql);
inf_Reader = inf_cmd.ExecuteReader();
if (inf_Reader.Read())
{
rate = Convert.ToDecimal(inf_Reader.GetString(0).Trim());
}
end/receive TCP/IP message
// *stas**************************************************************************************
|
|
|
Nice catch. Does not work in version 3.0 (build 2340) as well. |
|
|
build 2350 с UTF8 это никак не связано. ошибка должна была проявляться независимо от кодировки. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-12-29 06:03 | sbaftal | New Issue | |
| 2011-12-29 06:03 | sbaftal | File Added: 1.txt | |
| 2011-12-29 10:08 | Yegor | Note Added: 0008279 | |
| 2012-01-03 17:35 | 2useven10 | Assigned To | => 2useven10 |
| 2012-01-03 17:35 | 2useven10 | Status | new => assigned |
| 2012-01-03 19:25 | 2useven10 | Note Added: 0008308 | |
| 2012-01-03 19:25 | 2useven10 | Status | assigned => feedback |
| 2012-05-17 10:06 | 2useven10 | Build | => 2350 |
| 2012-05-17 10:06 | 2useven10 | Status | feedback => closed |
| 2012-05-17 10:06 | 2useven10 | Resolution | open => fixed |
| 2012-05-17 10:06 | 2useven10 | Fixed in Version | => 3.0 |