עברית ב asp.net = תסכול...

עברית ב asp.net = תסכול... ../images/Emo7.gif

חברים, עזרה, הושיעו! בניתי אפליקציית asp.net שכוללת עברית, והרבה. השרת ממוקם בחו"ל (ארה"ב). במחשב שלי העברית נראית בסדר, אבל אם אני עושה upload לשרת, העברית הופכת להיות סימני שאלה. קראתי את כל הטיפים והעזרה המוצעת בפורום, אבל שום דבר לא עזר עד הסוף: אם אני רואה עברית נכון, זה קורה כאשר אני הופך את ה charset של הדף ל Unicode, אבל אז כל ה Submitים נדפקים, כלומר השדות המתקבלים בשרת הופכים להיות ג'יבריש טהור. אני ממש מתוסכל מכל העניין הזה, כי זה כל כך עניין של איזו הגדרה טכנית, שזה פשוט מוציא אותי מדעתי. ותאמינו לי, כבר ניסיתי הרבה קומבינציות, ובסוף תוצאה אחת מהשתיים: תצוגת עברית דפוקה, או תצוגה נכונה אבל הערכים המתקבלים (בפקדי הסרבר) דפוקים. לצורך ההמחשה, צרפתי קוד של קובץ סתמי, וכן את ה web.config . אנא עזרו והושיעו... קובץ סתמי:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="heb_test_01.WebForm1" codePage="1255"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ... <HEAD> <title>WebForm1</title> <LINK href="Styles.css" type="text/css" rel="stylesheet"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 144px; POSITION: absolute; TOP: 144px" runat="server" Width="153px" Height="29px" BackColor="#FFFFC0">שלום</asp:Label> </form> </body> ...​
והנה web.config :
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to insert debugging symbols (.pdb information) into the compiled page. Because this creates a larger file that executes more slowly, you should set this value to true only when debugging and to false at all other times. For more information, refer to the documentation about debugging ASP.NET files. --> <compilation defaultLanguage="vb" debug="true" /> <!-- CUSTOM ERROR MESSAGES Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. Add <error> tags for each of the errors you want to handle. "On" Always display custom (friendly) messages. "Off" Always display detailed ASP.NET error information. "RemoteOnly" Display custom (friendly) messages only to users not running on the local Web server. This setting is recommended for security purposes, so that you do not display application detail information to remote clients. --> <customErrors mode="RemoteOnly" /> <!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None" "None" No authentication is performed. "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to its settings for the application. Anonymous access must be disabled in IIS. "Forms" You provide a custom form (Web page) for users to enter their credentials, and then you authenticate them in your application. A user credential token is stored in a cookie. "Passport" Authentication is performed via a centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. --> <authentication mode="Windows" /> <!-- AUTHORIZATION This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. --> <authorization> <allow users="*" /> <!-- Allow all users --> <!-- <allow users="[comma separated list of users]" roles="[comma separated list of roles]"/> &​
 
המשך (זה נקטע)

הקובץ web.config מחדש:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation defaultLanguage="vb" debug="true" /> <customErrors mode="RemoteOnly" /> <authentication mode="Windows" /> <authorization> <allow users="*" /> <!-- Allow all users --> </authorization> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" /> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" /> <!-- GLOBALIZATION This section sets the globalization settings of the application. --> <globalization requestEncoding="windows-1255" responseEncoding="windows-1255" /> </system.web> </configuration>​
 

SpecialNight

New member
למה לא encoding="windows-1255"

למרות שזה לא מה שיפתור את הבעיה נראה לי
 

adam222

New member
טכני?!

"כי זה כל כך עניין של איזו הגדרה טכנית..." אז בדיוק בשביל זה יש אנשים שהם מוכשרים לטפל בזה (אנשי רשתות, תשתיות, מנהלי רשתות ו-DBA's). איזה מערכת הפעלה יש על השרת? באיזה שפות המ"ה בשרת תומכת? האם אתה רואה את זה ב-DB? אם כן אז איך? ג'יבריש או סימני שאלה? איזה DB? באיזה שפות תומך הקלאסטר? ה-DB? השדה? בגלל שכל הפעולות נעשות על השרת ב-Submit אם הוא לא יודע לפענח את זה או שהשרת לא יודע לאכסן את זה בפורמט הנכון, אז כמובן שזה יגיע\יופיע בג'יבריש.
 
פרטים נוספים

תודה על התגובות. להלן פרטים נוספים: השרת בחו"ל כולל: מערכת הפעלה Windows 2003 Server (אני לא יודע איזו מהדורה בדיוק. אם זה יכול לפתור את העניין אנסה לברר). אני מניח שמערכת ההפעלה תומכת בכל השפות, כי זה host רציני. גם כאן אולי נדרש בירור נוסף. ה DB הוא MSSQL2000. כל השדות הרלוונטיים הם ב Collation של Hebrew_Bin , מסוג NVarChar . כל הוספה ל DB מתבצעת ע"י : SqlConnection SqlCommand Stored Procedure לפעמים אני מצליח להוסיף רשומות חדשות שבהן העברית מסודרת ולפעמים זה ג'יבריש, גם בתוך ה DB. אני יודע את זה כי יש לי אפשרות להיכנס ל DB עם ה EM, ולצפות בטבלאות וכן להזין ערכים באופן ידני. עד כאן פרטים נוספים. הייתי מאוד רוצה להבין ולדעת איזה פרמטרים בדיוק אני צריך לקבוע כדי שגם ה Submit יהיה תקין, וגם תצוגת הערכים תראה טוב. ושוב תודה לכל מי שעוזר!
 
אוקיי, מצאתי פתרון

ולהלן קישור... ואם משהו מתפקשש אז:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=06f501c36ade%2438433b40%24a101280a%40phx.gbl&rnum=6&prev=/groups%3Fq%3D%2522asp.net%2522%2Bhebrew%2Bdisplay%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D06f501c36ade%252438433b40%2524a101280a%2540phx.gbl%26rnum%3D6​
 

yuval k

New member
אם כך, למה לא תגדיר ב-web.config

response/requestEncoding של unicode? (ואז אתה לא צריך להגדיר אינדיבידואלית בדפים)
 
למעלה