Search Results

Search found 9564 results on 383 pages for 'character encoding'.

Page 10/383 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Display label character by character using javascript

    - by Muhammad Sajid
    Hi, I am creating Hang a Man using PHP, MySQL & Javascript. Every thing is going perfect, I get a word randomly from DB show it as a label apply it a class where display = none. Now when I click on a Character that character become disable fine which i actually want but the label-character does not show. My code is: <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <?php include( 'config.php' ); $question = questions(); // Get question. $alpha = alphabats(); // Get alphabets. ?> <script language="javascript"> function clickMe( name ){ var question = '<?php echo $question; ?>'; var questionLen = <?php echo strlen($question); ?>; for ( var i = 0; i < questionLen; i++ ){ if ( question[i] == name ){ var link = document.getElementById( name ); link.style.display = 'none'; var label = document.getElementById( 'questionLabel' + i ); label.style.display = 'block'; } } } </script> <div> <table align="center" style="border:solid 1px"> <tr> <?php for ( $i = 0; $i < 26; $i++ ) { echo "<td><a href='#' id=$alpha[$i] name=$alpha[$i] onclick=clickMe('$alpha[$i]');>". $alpha[$i] ."</a>&nbsp;</td>"; } ?> </tr> </table> <br/> <table align="center" style="border:solid 1px"> <tr> <?php for ( $i = 0; $i < strlen($question); $i++ ) { echo "<td class='question'><label id=questionLabel$i >". $question[$i] ."</label></td>"; } ?> </tr> </table> </div>

    Read the article

  • Display lable character by character using javascript

    - by Muhammad Sajid
    Hi, I am creating Hang a Man using PHP, MySQL & Javascript. Every thing is going perfect, I get a word randomly from DB show it as a label apply it a class where display = none. Now when I click on a Character that character become disable fine which i actually want but the label-character does not show. My code is: <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <?php include( 'config.php' ); $question = questions(); // Get question. $alpha = alphabats(); // Get alphabets. ?> <script language="javascript"> function clickMe( name ){ var question = '<?php echo $question; ?>'; var questionLen = <?php echo strlen($question); ?>; for ( var i = 0; i < questionLen; i++ ){ if ( question[i] == name ){ var link = document.getElementById( name ); link.style.display = 'none'; var label = document.getElementById( 'questionLabel' + i ); label.style.display = 'none'; } } } </script> <div> <table align="center" style="border:solid 1px"> <tr> <?php for ( $i = 0; $i < 26; $i++ ) { echo "<td><a href='#' id=$alpha[$i] name=$alpha[$i] onclick=clickMe('$alpha[$i]');>". $alpha[$i] ."</a>&nbsp;</td>"; } ?> </tr> </table> <br/> <table align="center" style="border:solid 1px"> <tr> <?php for ( $i = 0; $i < strlen($question); $i++ ) { echo "<td class='question'><label id=questionLabel$i >". $question[$i] ."</label></td>"; } ?> </tr> </table> </div>

    Read the article

  • Oracle Database character set issue with the audit tables on Debian

    - by Leonid Shirmanov
    I've got Oracle XE installed on Debian linux and the character set is configured to AL32UTF8. There are several client applications that connects to a database from Windows with the different locales - French etc, not English. That's ok with all the client data these applications put into database, nothing converted and text data in French represents correctly. But texts in audit tables looks like '??????' if contains any not-english character. I suppose this is because audit records go to database in the different locale and it's not dependent on the client's globalization/locale settings. How this globalization issue can be fixed? thanks!

    Read the article

  • Exclude all normal alphanumeric character from a mixed chinese-and-alphanumeric character word list

    - by Christine
    I have a list of chinese characters and normal alphanumeric characters, mixed together, and I want to get rid of any element that contains an alphanumeric character. Is there a simple way to do this? If I simply exclude any element that contains an alphanumeric character, I get no result because the chinese characters (in utf-8) are similarly affected. I also tried [w for w in fourchar if w.startswith("\x")] to try to get the chinese characters but I'm not sure if that's valid at all. I'm having difficulty figuring out what the alphanumeric characters are in unicode. Thanks for any help!

    Read the article

  • Load JSON in Python as header character set

    - by mridang
    Hi everyone, I've always found character sets and encodings complicated to understand and here I'm faced with another problem. My apologies for any inaccuracies. I'll do my best. I'm requesting data from a server which returns JSON. In the HTTP headers it also returns the character set like so: Content-Type: text/html; charset=UTF-8 I'm using the JSON library in Python to load the JSON using the json.loads method. When I pass it the returned JSON, it gives me a dictionary in Unicode. I've Googled around and I know that JSON should return Unicode as JavaScript strings are Unicode objects. How can I load the JSON as UTF-8? I would like to use the same encoding as specified in the response header. I've read this post but it didn't help. Thank you.

    Read the article

  • where should i encode this html data in an asp.net mvc site

    - by ooo
    here is my view code: <%=Model.HtmlData %> here is my controller code: public ActionResult GetPage() { ContentPageViewModel vm = new ContentPageViewModel(); vm.HtmlData = _htmlPageRepository.Get("key"); return View(vm); } my repository class basically queries a database table that has the fields: id, pageName, htmlContent the .Get() method passes in a pageName (or key) and returns the htmlContent value. Right now i have just started this (haven't persisted anything to the db yet) so i am not doing any explicit encoding in my code now. What is the best practice for where i need to do encoding (in the model, the controller, the view ??)

    Read the article

  • UTF-8 character encoding battles json_encode()

    - by Dave Jarvis
    Quest I am looking to fetch rows that have accented characters. The encoding for the column (NAME) is latin1_swedish_ci. The Code The following query returns Abord â Plouffe using phpMyAdmin: SELECT C.NAME FROM CITY C WHERE C.REGION_ID=10 AND C.NAME_LOWERCASE LIKE '%abor%' ORDER BY C.NAME LIMIT 30 The following displays expected values (function is called db_fetch_all( $result )): while( $row = mysql_fetch_assoc( $result ) ) { foreach( $row as $value ) { echo $value . " "; $value = utf8_encode( $value ); echo $value . " "; } $r[] = $row; } The displayed values: 5482 5482 Abord â Plouffe Abord â Plouffe The array is then encoded using json_encode: $rows = db_fetch_all( $result ); echo json_encode( $rows ); Problem The web browser receives the following value: {"ID":"5482","NAME":null} Instead of: {"ID":"5482","NAME":"Abord â Plouffe"} (Or the encoded equivalent.) Question The documentation states that json_encode() works on UTF-8. I can see the values being encoded from LATIN1 to UTF-8. After the call to json_encode(), however, the value becomes null. How do I make json_encode() encode the UTF-8 values properly? One possible solution is to use the Zend Framework, but I'd rather not if it can be avoided.

    Read the article

  • Ajax / Internet Explorer Encoding problem

    - by mnml
    Hi, I'm trying to use JQuery's autocomplete plug-in but for some reasons Internet Explorer is not compatible with the other browsers: When there is an accent in the "autocompleted" string it passes it with another encoding. IP - - [20/Apr/2010:15:53:17 +0200] "GET /page.php?var=M\xe9tropole HTTP/1.1" 200 13024 "http://site.com/page.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" IP - - [20/Apr/2010:15:53:31 +0200] "GET /page.php?var=M%C3%A9tropole HTTP/1.1" 200 - "http://site.com/page.php" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2" I would like to know if there is anyway I can still decode those variables to output the same result.

    Read the article

  • Encoding MySQL text fields into UTF-8 text files - problems with special characters

    - by Matt Andrews
    I'm writing a php script to export MySQL database rows into a .txt file formatted for Adobe InDesign's internal markup. Exports work, but when I encounter special characters like é or umlauts, I get weird symbols (eg Chloë Hanslip instead of Chloë Hanslip). Rather than run a search and replace for every possible weird character, I need a better method. I've checked that when the text hits the database, it's saved properly - in the database I see the special characters. My export code basically runs some regular expressions to put in the InDesign code tags, and I'm left with the weird symbols. If I just output the text to the browser (rather than prompt for a text file download), it displays properly. When I save the file I use this code: header("Content-disposition: attachment; filename=test.txt"); header("Content-Type: text/plain; charset=utf-8"); I've tried various combinations of utf8_encode() and iconv() to no avail. Can anybody point me in the right direction here?

    Read the article

  • C# - File Encoding Problem.

    - by user301330
    Hello, I'm have a StringBuilder that is writing content to a file. Towards the end of each file, I'm writing the copyright symbol. Oddly, I have noticed that whenever the copyright symbol is written, it is preceeded by a "Â". My code that generates the content of the file looks like this: using (StringWriter stringWriter = new StringWriter()) { stringWriter = GetFileContent(); string targetPath = ConfigurationManager.AppSettings["TargetPath"]; using (StreamWriter streamWriter = new StreamWriter(targetPath, false)) { StringBuilder sb = new StringBuilder(stringWriter.ToString()); // Attempted fix string content = sb.ToString(); content = content.Replace("Â", ""); streamWriter.Write(content); } } As you can tell, I tried to do a find-and-replace. In the process, I noticed that a "Â" was not in the content itself. This makes me believe there is something occurring in the streamWriter. However, I'm not sure what it could be. Can someone please tell me why a "Â" would be popping up before the "©" symbol and how to fix it? I believe it has something to do with encoding, but I'm not sure Thank you!

    Read the article

  • Primefaces push encoding

    - by kalaoke
    I use primefaces push to write a message in a p:notificationBar. if i push a message with specials characters (like russians char), I've got '?' in my message. How can I fix this problem ? Thanks for your help. (config : primefaces 3.4 and jsf2. All my html pages are utf8 encoding). Here is my view code : <p:notificationBar id="bar" widgetVar="pushNotifBar" position="bottom" style="z-index: 3;border: 8px outset #AB1700;width: 97%;background: none repeat scroll 0 0 #CA837D;"> <h:form prependId="false"> <p:commandButton icon="ui-icon-close" title="#{messages['gen.close']}" styleClass="ui-notificationbar-close" type="button" onclick="pushNotifBar.hide();"/> </h:form> <h:panelGrid columns="1" style="width: 100%; text-align: center;"> <h:outputText id="pushNotifSummary" value="#{growlBean.summary}" style="font-size:36px;text-align:center;"/> <h:outputText id="pushNotifDetail" value="#{growlBean.detail}" style="font-size: 20px; float: left;" /> </h:panelGrid> </p:notificationBar> <p:socket onMessage="handleMessage" channel="/notifications"/> <script type="text/javascript"> function handleMessage(data) { var substr = data.split(' %% '); $('#pushNotifSummary').html(substr[0]); $('#pushNotifDetail').html(substr[1]); pushNotifBar.show(); } </script> and my Bean code : public void send() { PushContext pushContext = PushContextFactory.getDefault().getPushContext(); String var = summary + " %% " + detail; pushContext.push("/notifications", var);

    Read the article

  • Django db encoding

    - by realshadow
    Hey, I have a little problem with encoding. The data in db is ok, when I select the data in php its ok. Problem comes when I get the data and try to print it in the template, I get - Å port instead of Šport, etc. Everything is set to utf-8 - in settings.py, meta tags in template, db table and I even have unicode method specified for the model, but nothing seems to work. I am getting pretty hopeless here... Here is some code: class Category_info(models.Model): objtree_label_id = models.AutoField(primary_key = True) node_id = models.IntegerField(unique = True) language_id = models.IntegerField() label = models.CharField(max_length = 255) type_id = models.IntegerField() class Meta: db_table = 'objtree_labels' def __unicode__(self): return self.label I have even tried with return u"%s" % self.label. Here is the view: def categories_list(request): categories_list = Category.objects.filter(parent_id = 1, status = 1) paginator = Paginator(categories_list, 10) try: page = int(request.GET.get('page', 1)) except ValueError: page = 1 try: categories = paginator.page(page) except (EmptyPage, InvalidPage): categories = paginator.page(paginator.num_pages) return render_to_response('categories_list.html', {'categories': categories}) Maybe I am just blind and/or stupid, but it just doesnt work. So any help is appreciated, thanks in advance. Regards

    Read the article

  • MediaFileUpload of HTML in UTF-8 encoding using Python and Google-Drive-SDK

    - by Victoria
    Looking for example using MediaFileUpload has a reference to the basic documentation for creating/uploading a file to Google Drive. However, while I have code that creates files, converting from HTML to Google Doc format. It works perfectly when they contain only ASCII characters, but when I add a non-ASCII character, it fails, with the following traceback: Traceback (most recent call last): File "d:\my\py\ckwort.py", line 949, in <module> rids, worker_documents = analyze( meta, gd ) File "d:\my\py\ckwort.py", line 812, in analyze gd.mkdir( **iy ) File "d:\my\py\ckwort.py", line 205, in mkdir self.create( **( kw['subop'])) File "d:\my\py\ckwort.py", line 282, in create media_body=kw['media_body'], File "D:\my\py\gdrive2\oauth2client\util.py", line 120, in positional_wrapper return wrapped(*args, **kwargs) File "D:\my\py\gdrive2\apiclient\http.py", line 676, in execute headers=self.headers) File "D:\my\py\gdrive2\oauth2client\util.py", line 120, in positional_wrapper return wrapped(*args, **kwargs) File "D:\my\py\gdrive2\oauth2client\client.py", line 420, in new_request redirections, connection_type) File "D:\my\py\gdrive2\httplib2\__init__.py", line 1597, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "D:\my\py\gdrive2\httplib2\__init__.py", line 1345, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "D:\my\py\gdrive2\httplib2\__init__.py", line 1282, in _conn_request conn.request(method, request_uri, body, headers) File "C:\Python27\lib\httplib.py", line 958, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 992, in _send_request self.endheaders(body) File "C:\Python27\lib\httplib.py", line 954, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 812, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 370: ordinal not in range(128) I don't find any parameter to use to specify what file encoding should be used by MediaFileUpload (My files are using UTF-8). Am I missing something?

    Read the article

  • Form Encoding Problems on GRAILS 2.0

    - by ArmlessJohn
    I have an Grails application that is configured everywhere to function as UTF-8. While running a debug version, headers say Content-Type:text/html;charset=utf-8, and meta tags agree. Browser identified page as UTF-8 and shows characters correctly. When posting a form, the browser correctly sends it encoded as UTF-8. When reading the data via params.paramname, however, the data looks garbled; maçã becomes maçã. Upon further inspection, it seems the form is sending UTF-8 data, but Grails seem to try and read it as if it was ISO-8859-1. Setting accept-charset="ISO-8859-1" on the form confirms this problem, as it fixes the problem. I also have this on applicationContext.xml: <bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter"> <property name="encoding"> <value>utf-8</value> </property> <property name="forceEncoding"> <value>true</value> </property> </bean> Is there an solution for this besides adding accept-charset="ISO-8859-1" to all forms in the application? Thanks.

    Read the article

  • convert jruby 1.8 string to windows encoding?

    - by Arne
    Hey, I want to export some data from my jruby on rails webapp to excel, so I create a csv string and send it as a download to the client using send_data(text, :filename => "file.csv", :type => "text/csv; charset=CP1252", :encoding => "CP1252") The file seems to be in UTF-8 which Excel cannot read correctly. I googled the problem and found that iconv can convert encodings. I try to do that with: ic = Iconv.new('CP1252', 'UTF-8') text = ic.iconv(text) but when I send the converted text it does not make any difference. It is still UTF-8 and Excel cannot read the special characters. there are several solutions using iconv, so this seems to work for others. When I convert the file on the linux shell manually with iconv it works. What am I doing wrong? Is there a better way? Im using: - jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.6.0_19) [i386-java] - Debian Lenny - Glassfish app server - Iceweasel 3.0.6

    Read the article

  • Freemarker - lack of special character in email subject template cause email content crash

    - by freakman
    im fighting with strange error. Im using seperate freemarker templates for mail subject and body. It is sent using org.springframework.mail.javamail.JavaMailSender. Only templates that contains some special swedish character works in my application ( yes you read right... not the other way). If I delete it my email content crashes. It contains then: MIME-Version: 1.0 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: 7bit .. html code here .. My freemarker.properties file locale=sv_SE classic_compatible=false number_format= date_format=yyyy-MM-dd time_format=HH:mm datetime_format=yyyy-MM-dd HH:mm output_encoding=UTF-8 url_escaping_charset=UTF-8 auto_import=spring.ftl as spring auto_include= default_encoding=UTF-8 localized_lookup=true strict_syntax=true whitespace_stripping=true template_update_delay=10 Ive tried to convert subject file with dos2unix tool. Using 'find -bi subject.ftl' show that encoding is us-ascii. With added special character - utf-8. This thing is suprisingly strange for me... //SOLUTION: use :set bomb and save file in vim.

    Read the article

  • Weird character at start of json content type

    - by Nek
    Hi, I'm trying to return json content read from MySQL server. This is supposed to be easy but, there is a 'weird' character that keeps appearing at start of the content. I have two pages for returning content: kcb433.sytes.net/as/test.php?json=true&limit=6&input=d this test.php is from a script written by Timothy Groves, which converts an array to json output http://kcb433.sytes.net/k.php?k=4 this one is supposed to do the same I tried to validate it here jsonformatter.curiousconcept.com but just page 1 gets validated, page 2 says that it does not contain JSON data. If accessed directly both pages has no problems. Then what is the difference, why both don't get validated? Then I found this page jsonformat.com and tried the same thing. Page 1 was ok and page 2 wasn't but, surprisingly the data could be read. At a glance, {"a":"b"} may look good but there is a character in front. According to a hex editor online, this is the value of the string above (instead of 9 values, there are 10): -- 7B 22 61 22 3A 22 62 22 7D The code to echo json in page 2 is: header("Content-Type: application/json"); echo "{\"a\":\"b\"}";

    Read the article

  • '£' character does not seem to encode properly - expect '%a3' but get '%u00a3'

    - by user243143
    Hello, I want to send The pound sign character i.e. '£' encoded as ISO-8859-1 across the wire. I perform this by doing the following: var _encoding = Encoding.GetEncoding("iso-8859-1"); var _requestContent = _encoding.GetBytes(requestContent); var _request = (HttpWebRequest)WebRequest.Create(target); _request.Headers[HttpRequestHeader.ContentEncoding] = _encoding.WebName; _request.Method = "POST"; _request.ContentType = "application/x-www-form-urlencoded; charset=iso-8859-1"; _request.ContentLength = _requestContent.Length; _requestStream = _request.GetRequestStream(); _requestStream.Write(_requestContent, 0, _requestContent.Length); _requestStream.Flush(); _requestStream.Close(); When I put a breakpoint at the target, I expect to receive the following: '%a3', however I receive '%u00a3' instead. We have tested many odd characters, but '£' seems to be the only character where theres a problem. Does anyone know what the problem is here? - Help would be greatly appreciated... Billy

    Read the article

  • In MySQL how can I tell what character set a particular table is using?

    - by muudscope
    I have a large mysql table that I think might be using the wrong character set. If so I'll need to change it using ALTER TABLE mytable CONVERT TO CHARACTER SET utf8 But since this is a very large table, I'd rather not run this command unless I have to. So my question is, how can I ask mysql what the character set is on a particular table? I can call status in mysql to see the database's character set, but that doesn't necessarily mean all the tables have the same character set, right?

    Read the article

  • New <%: %> Syntax for HTML Encoding Output in ASP.NET 4 (and ASP.NET MVC 2)

    - by ScottGu
    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] This is the nineteenth in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release. Today’s post covers a small, but very useful, new syntax feature being introduced with ASP.NET 4 – which is the ability to automatically HTML encode output within code nuggets.  This helps protect your applications and sites against cross-site script injection (XSS) and HTML injection attacks, and enables you to do so using a nice concise syntax. HTML Encoding Cross-site script injection (XSS) and HTML encoding attacks are two of the most common security issues that plague web-sites and applications.  They occur when hackers find a way to inject client-side script or HTML markup into web-pages that are then viewed by other visitors to a site.  This can be used to both vandalize a site, as well as enable hackers to run client-script code that steals cookie data and/or exploits a user’s identity on a site to do bad things. One way to help mitigate against cross-site scripting attacks is to make sure that rendered output is HTML encoded within a page.  This helps ensures that any content that might have been input/modified by an end-user cannot be output back onto a page containing tags like <script> or <img> elements.  ASP.NET applications (especially those using ASP.NET MVC) often rely on using <%= %> code-nugget expressions to render output.  Developers today often use the Server.HtmlEncode() or HttpUtility.Encode() helper methods within these expressions to HTML encode the output before it is rendered.  This can be done using code like below: While this works fine, there are two downsides of it: It is a little verbose Developers often forget to call the HtmlEncode method New <%: %> Code Nugget Syntax With ASP.NET 4 we are introducing a new code expression syntax (<%:  %>) that renders output like <%= %> blocks do – but which also automatically HTML encodes it before doing so.  This eliminates the need to explicitly HTML encode content like we did in the example above.  Instead you can just write the more concise code below to accomplish the same thing: We chose the <%: %> syntax so that it would be easy to quickly replace existing instances of <%= %> code blocks.  It also enables you to easily search your code-base for <%= %> elements to find and verify any cases where you are not using HTML encoding within your application to ensure that you have the correct behavior. Avoiding Double Encoding While HTML encoding content is often a good best practice, there are times when the content you are outputting is meant to be HTML or is already encoded – in which case you don’t want to HTML encode it again.  ASP.NET 4 introduces a new IHtmlString interface (along with a concrete implementation: HtmlString) that you can implement on types to indicate that its value is already properly encoded (or otherwise examined) for displaying as HTML, and that therefore the value should not be HTML-encoded again.  The <%: %> code-nugget syntax checks for the presence of the IHtmlString interface and will not HTML encode the output of the code expression if its value implements this interface.  This allows developers to avoid having to decide on a per-case basis whether to use <%= %> or <%: %> code-nuggets.  Instead you can always use <%: %> code nuggets, and then have any properties or data-types that are already HTML encoded implement the IHtmlString interface. Using ASP.NET MVC HTML Helper Methods with <%: %> For a practical example of where this HTML encoding escape mechanism is useful, consider scenarios where you use HTML helper methods with ASP.NET MVC.  These helper methods typically return HTML.  For example: the Html.TextBox() helper method returns markup like <input type=”text”/>.  With ASP.NET MVC 2 these helper methods now by default return HtmlString types – which indicates that the returned string content is safe for rendering and should not be encoded by <%: %> nuggets.  This allows you to use these methods within both <%= %> code nugget blocks: As well as within <%: %> code nugget blocks: In both cases above the HTML content returned from the helper method will be rendered to the client as HTML – and the <%: %> code nugget will avoid double-encoding it. This enables you to default to always using <%: %> code nuggets instead of <%= %> code blocks within your applications.  If you want to be really hardcore you can even create a build rule that searches your application looking for <%= %> usages and flags any cases it finds as an error to enforce that HTML encoding always takes place. Scaffolding ASP.NET MVC 2 Views When you use VS 2010 (or the free Visual Web Developer 2010 Express) you’ll find that the views that are scaffolded using the “Add View” dialog now by default always use <%: %> blocks when outputting any content.  For example, below I’ve scaffolded a simple “Edit” view for an article object.  Note the three usages of <%: %> code nuggets for the label, textbox, and validation message (all output with HTML helper methods): Summary The new <%: %> syntax provides a concise way to automatically HTML encode content and then render it as output.  It allows you to make your code a little less verbose, and to easily check/verify that you are always HTML encoding content throughout your site.  This can help protect your applications against cross-site script injection (XSS) and HTML injection attacks.  Hope this helps, Scott

    Read the article

  • Harmonizing Character Encoding Between Imported Data and MySQL

    MySQL's Latin-1 default encoding combined with MySQL 4.1.12's (or greater) UTF8 encoding allows the maximum number of characters codes, however incoming data with different character encoding can still present problems. Rob Gravelle shows you how to avoid problems before a lot of work is required to undo the damage.

    Read the article

  • Harmonizing Character Encoding Between Imported Data and MySQL

    MySQL's Latin-1 default encoding combined with MySQL 4.1.12's (or greater) UTF8 encoding allows the maximum number of characters codes, however incoming data with different character encoding can still present problems. Rob Gravelle shows you how to avoid problems before a lot of work is required to undo the damage.

    Read the article

  • Can I use a genetic algorithm for balancing character builds?

    - by Renan Malke Stigliani
    I'm starting to build a online PVP (duel like, one-on-one) game, where there is leveling, skill points, special attacks and all the common stuff. Since I have never done anything like this, I'm still thinking about the math behind the levels/skills/specials balance. So I thought a good way of testing the best builds/combos, would be to implement a Genetic Algorithm. It'd be like this: Generate a big group of random characters Make them fight, level them up accordingly to their victories(more XP)/losses(less XP) Mate the winners, crossing their builds, to try and make even better characters Add some more random chars, emulating new players Repeat the process for some time, or util I find some chars who can beat everyone's butt I could then play with the math and try to find better balances to make sure that the top x% of chars would be a mix of various build types. So, is it a good idea, or is there some other, easier method to do the balancing?

    Read the article

  • Read All Text from Textfile with Encoding in Windows RT

    - by jdanforth
    A simple extension for reading all text from a text file in WinRT with a specific encoding, made as an extension to StorageFile: public static class StorageFileExtensions {     async public static Task<string> ReadAllTextAsync(this StorageFile storageFile)     {         var buffer = await FileIO.ReadBufferAsync(storageFile);         var fileData = buffer.ToArray();         var encoding = Encoding.GetEncoding("Windows-1252");         var text = encoding.GetString(fileData, 0, fileData.Length);         return text;     } }

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >