Search Results

Search found 5303 results on 213 pages for 'encoding'.

Page 6/213 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How to apply encoding when reading from a serial port

    - by rross
    I'm reading data from a serial port. I read this posting: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a709d698-5099-4e37-9e10-f66ff22cdd1e He is writing about many of the issues I have encounter, but in his writing he refers to using: System.Text.Encoding.GetEncoding("Windows-1252"). The problem I'm having is when and how to apply this. There are three potitional spots in my opinion. When the serial port object is define: private SerialPort comport = new SerialPort(); The Event handler: comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); Or when reading the data: string data = comport.ReadExisting(); No matter where I add it. I seem to get errors. How would one use Encoding?

    Read the article

  • Eclipse javascript character encoding

    - by Bardock
    Hi, I'd like to display some language specific characters from javascript but I can't. My app is a Java webapp and the front end is jQuery. All the characters that are sended from the server - in a JSP or with AJAX - are displayed properly. When I want to display some text hardcoded in to the javascript file it's broken. I'm using Eclipse. In the JSP's header I use: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> I've tried this (charset in the script element) too: <script type="text/javascript" charset="utf-8"><c:import url="/JS/mainJS.js" /></script> In my Eclipse I've set the project properties / text file encoding to UTF-8 AND I've checked the JS files' resource properties / text file encoding that is UTF-8 too. But when I try this: $.test = function(){ var s = "éééáááuuuu"; alert(s); } I get: éééáááűűűű The strange thing is that: When I try in a separate html file (in the same project), It's working: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Test</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <style type="text/css"> body {background: #c0c0c0;} </style> <script type="text/javascript"> $(document).ready(function(){ var s = "éááuuúúú"; $("#console").text(s); alert(s); }) </script> </head> <body> <div id="console"></div> </body> </html> Even if I DO NOT use any content type and page encoding settings. What is the problem? What shall I do? (I'm using Apache Tomcat integrated in Eclipse) Thanks in advance!

    Read the article

  • Character encoding problem in my website.

    - by vikyboss
    I own a website that was recently moved to a different server, now I can see some weird characters. Initially the website was coded with UTF-8 encoding. The weird characters disappears if I change the View Character encoding to Western(8859-1) in my browser. Therefore, I changed the source of the website to use this Western one, but still I can see the weird characters and they doesn't seem to disappear. Can anyone help me with this. Thanks in advance.

    Read the article

  • Encoding regarding Term::Size

    - by sid_com
    Hello! The Term::Size-module jumbles up the encoding. How can I fix this? #!/usr/bin/env perl use warnings; use strict; use 5.010; use utf8; binmode STDOUT, ':encoding(UTF-8)'; use Term::Size; my $string = 'Hällö'; say $string; my $columns = ( Term::Size::chars *STDOUT{IO} )[0]; say $columns; say $string; Output: Hällö 140 H?ll?

    Read the article

  • Need a simple program to convert to utf-8

    - by Null
    I need to find a program to convert a Windows-1250 encoded file to utf8. It needs to be a standalone program (not a python script) and it needs to run on windows (without install). If I can make the conversion using the commandline that would be perfect. Yes I know notepad can do that but this is meant to be automated.

    Read the article

  • PHP: Writing non-english characters to XML - encoding problem

    - by Dean
    Hello, I wrote a small PHP script to edit the site news XML file. I used DOM to manipulate the XML (Loading, writing, editing). It works fine when writing English characters, but when non-English characters are written, PHP throws an error when trying to load the file. If I manually type non-English characters into the file - it's loaded perfectly fine, but if PHP writes the non-English characters the encoding goes wrong, although I specified the utf-8 encoding. Any help is appreciated. Errors: Warning: DOMDocument::load() [domdocument.load]: Entity 'times' not defined in filepath Warning: DOMDocument::load() [domdocument.load]: Input is not proper UTF-8, indicate encoding ! Bytes: 0x91 0x26 0x74 0x69 in filepath Here are the functions responsible for loading and saving the file (self-explanatory): function get_tags_from_xml(){ // Load news entries from XML file for display $errors = Array(); if(!$xml_file = load_news_file()){ // Load file // String indicates error presence $errors = "file not found"; return $errors; } $taglist = $xml_file->getElementsByTagName("text"); return $taglist; } function set_news_lang(){ // Sets the news language global $news_lang; if($_POST["news-lang"]){ $news_lang = htmlentities($_POST["news-lang"]); } elseif($_GET["news-lang"]){ $news_lang = htmlentities($_GET["news-lang"]); } else{ $news_lang = "he"; } } function load_news_file(){ // Load XML news file for proccessing, depending on language global $news_lang; $doc = new DOMDocument('1.0','utf-8'); // Create new XML document $doc->load("news_{$news_lang}.xml"); // Load news file by language $doc->formatOutput = true; // Nicely format the file return $doc; } function save_news_file($doc){ // Save XML news file, depending on language global $news_lang; $doc->saveXML($doc->documentElement); $doc->save("news_{$news_lang}.xml"); } Here is the code for writing to XML (add news): <?php ob_start()?> <?php include("include/xml_functions.php")?> <?php include("../include/functions.php")?> <?php get_lang();?> <?php //TODO: ADD USER AUTHENTICATION! if(isset($_POST["news"]) && isset($_POST["news-lang"])){ set_news_lang(); $news = htmlentities($_POST["news"]); $xml_doc = load_news_file(); $news_list = $xml_doc->getElementsByTagName("text"); // Get all existing news from file $doc_root_element = $xml_doc->getElementsByTagName("news")->item(0); // Get the root element of the new XML document $new_news_entry = $xml_doc->createElement("text",$news); // Create the submited news entry $doc_root_element->appendChild($new_news_entry); // Append submited news entry $xml_doc->appendChild($doc_root_element); save_news_file($xml_doc); header("Location: /cpanel/index.php?lang={$lang}&news-lang={$news_lang}"); } else{ header("Location: /cpanel/index.php?lang={$lang}&news-lang={$news_lang}"); } ?> <?php ob_end_flush()?>

    Read the article

  • Strage character encoding problem with Eclipse / Spring / Tomcat 6

    - by Czar
    Hi, I have been trying things all da but can't get a proper solution. My problem is: I am developing a Spring MVC based app in my local Tomcat. My MYSQl database has UTF-8 encoding set, all content in there displays properly when using phpMyAdmin. Also the output in LOG files using log4j in catalina.out works fine. My JSP pages are configured by <!-- encoding --> <%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8" %> Also showing data on my JSP works fine. I can also send data from my Controller without any DB intereference using special chars, e.g. String str = "UTF-8 Test: Ä Ö Ü ß è é â"; logger.debug(str); mav.addObject("utftest", str); That displays correctly in log and on jsp page in browser. BUT: When having special chars directly in my JSP file, e.g. for text in headers, this does not work. FF and Google Chrome display strange chars but report the page to be UTF-8. When switching to Latin, the chars just get more and more strange. Same problem when showing text tokens from my messages.properties file, although Eclipse says when right-clicking that UTF-8 will be used. I am a little it lost and don't know where to check now. Summary: DB storage is fine DB output on JSP is fine Output on JSP directly form controller is fine even reading in form forms is fine .properties files and JSP text is not fine !!! Any ideas? I really appreciate and tips.

    Read the article

  • Office Automation: What does destroy my encoding?

    - by Filburt
    I'm facing a problem with a Word Mail Merge Automation controlled by our CRM system. The setup Base for the Mail Merge is a Word .dot template which fires a macro on Document.New. Inside this macro I create a .Net component registered for COM. Set myCOMObject = CreateObject("MyCOMObject") The component pulls some data from a database and hands string values which are assigned to Word DocumentVariables. Set someClass = myCOMObject.GetSomeClass(123) ActiveDocument.Variables("docaddress") = someClass.GetSenderAddress(456) All string values returned from the component are encoded in UTF-8 (codepage 1200). What happens The problem arises when the CRM system calls Word to perform the Mail Merge: The string values from the component are turned into UTF-8 encoded strings. All the static text inside the template and the data pulled for the Mail Merge stay nicely encoded in UTF-16 - example the umlaut ü inside my DocumentVariables is turned into c3 b0 while it stays fc for the rest of the document (checked file in hex editor). If I'm creating a document from a template with the same macro functionallity but without performing a Mail Merge all strings are fine; i.e. are encoded in UTF-16. What changed According to the CRM software vendor the encoding of the Mail Merge data export was changed to UTF-16 with the new version we're currently testing. I found out that MS states that you'll expirience issues when the document and the Mail Merge data file encoding don't match. What I tried Since I'm assuming to merge with UTF-16 encoded data I added the following lines to my macro: ActiveDocument.TextEncoding = msoEncodingWestern ActiveDocument.SaveEncoding = msoEncodingUnicodeLittleEndian This is what the Mail Merge data document specifies in its document properties.

    Read the article

  • PHP Json Encoding w/ quote escaping in 5.2?

    - by NickAldwin
    I'm playing with the flickr api and php. I want to pass some information from PHP to Javascript through Ajax. I have the following code: json_encode($pics); which results in the following example JSON string: [{"id":"4363603591","title":"blue, white and red...another seattle view","date_faved":"1266379499"},{"id":"4004908219","title":"\u201cI just told you my dreams and you made me see that I could walk into the sun and I could still be me and now I can't deny nothing lasts forever.\u201d","date_faved":"1259987670"}] Javascript has problems with this, however, due to the unescaped single-quote in the second item ("can't deny"). I want to use the function json_encode with the options parameter to make it strip the quotes, but that's only available in PHP 5.3, and I'm running 5.2 (not my server). Is there a fast way to run through the entire array and escape everything before encoding it in Json? I looked for a way to do this, but it all seems to deal with encoding it as the data is generated, something I cannot do as I'm not the one generating the data. If it helps, I'm currently using the following javascript after the ajax request: var photos = eval('(' + resptxt + ')');

    Read the article

  • Space-saving character encoding for japanese?

    - by Constantin
    In my opinion a common problem: character encoding in combination with a bitmap-font. Most multi-language encodings have an huge space between different character types and even a lot of unused code points there. So if I want to use them I waste a lot of memory (not only for saving multi-byte text - i mean specially for spaces in my bitmap-font) - and VRAM is mostly really valuable... So the only reasonable thing seems to be: Using an custom mapping on my texture for i.e. UTF-8 characters (so that no space is waste). BUT: This effort seems to be same with use an own proprietary character encoding (so also own order of characters in my texture). In my specially case I got texture space for 4096 different characters and need characters to display latin languages as well as japanese (its a mess with utf-8 that only support generall cjk codepages). Had somebody ever a similiar problem (I really wonder, if not)? If theres already any approach? Edit: The same Problem is described here http://www.tonypottier.info/Unicode_And_Japanese_Kanji/ but it doesnt provide an real solution how to save these bitmapfont mappings to utf-8 space efficent. So any further help is welcome!

    Read the article

  • Google App Engine datastore encoding?

    - by sernaferna
    I'm using the GAE datastore for a Java application, and storing some text that will be in numerous languages. In my servlet, I'm first checking to see if there's any data in the data store, and, if not, I'm creating some, similar to the following: ArrayList<Lang> list = new ArrayList<Lang>(); list.add(new Lang("EN", "English", 1)); list.add(new Lang("ES", "Español", 0)); //more languages here... PersistenceManager pm = PMF.get().getPersistenceManager(); for(Lang l : list) { pm.makePersistent(l); } Since this is using JDO, I guess I should include the relevent parts of the Lang class too: @PersistenceCapable public class Lang { @PrimaryKey private String code; @Persistent private String name; @Persistent private int popularity; // getters & setters & constructors... } However, the non-ASCII characters are giving me grief. I've set my Eclipse project to use the UTF-8 encoding instead of the default Cp1252, so I think I'm okay from that perspective, but when I use the App Engine Data Viewer to look at my data, that Español entry becomes Español, and when I click on it to view it, I get a 500 Server Error. (There are some other entries with right-to-left text that don't even show up in the Data Viewer at all, but one problem at a time...) Is there anything special I can do in my code to set the character encoding, or specify to GAE that the data I'm storing is UTF-8? Or is the problem on the Eclipse side, and is there something I should be doing with my Java code?

    Read the article

  • How change encoding ?

    - by simply denis
    I need convert or set encoding windows-1251 Process p = new Process(); StreamWriter sw; StreamReader sr; StreamReader err; ProcessStartInfo psI = new ProcessStartInfo("cmd"); psI.UseShellExecute = false; psI.RedirectStandardInput = true; psI.RedirectStandardOutput = true; psI.RedirectStandardError = true; psI.CreateNoWindow = true; p.StartInfo = psI; p.Start(); sw = p.StandardInput; sr = p.StandardOutput; err = p.StandardError; sw.AutoFlush = true; if (tbComm.Text != "") sw.WriteLine(tbComm.Text); else //execute default command sw.WriteLine("dir \\"); sw.Close(); textBox1.Text = sr.ReadToEnd();// this not support russian word. I need convert or set encoding windows-1251 textBox1.Text += err.ReadToEnd();

    Read the article

  • Dreaded python encoding errors, how to stop them?

    - by Rhubarb
    These have been plaguing me endlessly. Why? It seems that my console can't handle the encoding. I take it that the my browser and word processor can handle it. I don't have a master list of all the possible characters that it's choking on. What is the best way to relieve this without modifying my data? 'charmap' codec can't encode character u'\xca'

    Read the article

  • ASP/VBScript ServerXmlHttp Encoding

    - by colinramsay
    I'm pulling an RSS feed from a remote location using ServerXmlHttp: Dim httpRequest set httpRequest = server.createObject("Msxml2.ServerXMLHTTP.6.0") httpRequest.open "GET", "http://www.someurl.com/feed.xml", false httpRequest.send() response.write httpRequest.responseXML.xml However there must be encoding issues somewhere along the line as I'm seeing ???? where there should be some Japanese characters. Does anyone have any guidance when working with ServerXmlHttp? Thanks.

    Read the article

  • Real-time wmv video encoding in C#

    - by Greg Roberts
    How to encode video on the fly and send it trough the network from C#? Can't find a suitable library. I need to encode in WMV and don't mind if the actual encoding is made in C++ as long as the library has a .NET assembly available. Thanks

    Read the article

  • Encoding Issue [NSFW]

    - by azz0r
    Hello, I am having issues correcting an encoding type issue on a site. Unfortunately the site is non work safe (gay porn). For the brave: http://www.alphamalemedia.com/index/news Ive tried setting the meta content from utf8 to iso-8859-1. Ive switched tables over to utf8 from latin1_swedish_ci but no luck.

    Read the article

  • data format encoding and etc

    - by hguser
    Hi: I Suddenly found that I have no idea about the concept of data format and the encoding. For exmpale, what is the differences about the ascii/binary/base64/text-xml ? For a real case, I am working with a web service whose parameter I have to define,however one of the parameter should be ascii,another is binary and the last is netcdf. So,how to define it? ALso I wonder the ascii needed parameter can be a .txt or .dat ?

    Read the article

  • Java Unicode encoding

    - by Marcus
    A Java char is 2 bytes (max size of 65,536) but there are 95,221 Unicode characters. Does this mean that you can't handle certain Unicode characters in a Java application? Does this boil down to what character encoding you are using?

    Read the article

  • utf8 and encoding

    - by Dan
    I have a sting in unicode is "hao123--??????", while in utf8 in C++ string is "hao123???????????>", but I should write it to a file in this format "hao123\uFF0D\uFF0D\u6211\u7684\u4E0A\u7F51\u4E3B\u9875", how can I do it. I know little about this encoding. Can anyone help? thanks!

    Read the article

  • Ruby encoding problem

    - by Fossmo
    I'm just starting to learn Ruby and have a problem with encoding; require 'rubygems' require 'mechanize' agent = Mechanize.new agent.get('myurl.....') agent.page.search('#reciperesult a').each do |item| c = Mechanize.new c.get(item.attributes['href']) puts c.page.search('#ingredients li').text end The output text are shown like this h+©nsekj+©tt when it should have been shown like this hønsekjøtt. I'm using Ruby 1.8.7. Can anybody point me in the right direction?

    Read the article

  • .NET Weird character encoding issue

    - by born to hula
    Our globalization mechanism stores error messages in a SQL 2005 DB. Some of the error messages are used as subjects on email messages sent to the development team. Recently, with no clear reason, we started receiving emails with strangely encoded subjects, such as: =?utf-8?B?Qm1mQm92ZXNwYS5Qb3NUcmFkaW5nRXNwZWNpZmljYWNhbyAtIFN1Y2Vzc28gbm8gcmVwcm 9jZXNzYW1lbnRvLiBEYXRhIFByZWfDo28gPSAzMS8wMy8yMDEwIDAwOjAwOjAwIC0gTsO6bWVyby BkbyBFdmVudG8gZGUgTmVnw7NjaW8gPSAxMDAyIC0gQ8OzZGlnbyBOYXR1cmV6YSBkYSBPcGVyY cOnw6NvID0gQyAtIFNlcn... We don't have any clue on the reason this is happening, nor which encoding pattern is being used here (maybe utf-8?). I'd really appreciate some help.

    Read the article

  • PHP: simple form encoding/decoding

    - by Lennart
    Hi guys, Probably, this question has been asked before, though, I'll ask it again. Currently, I'm facing a problem with form encoding. When posting my form, all spaces are replaced by the "+" character. I would like to replace this "+" character by a real space. Does someone has a PHP solution for this? Thanks in advance. Cheers, Lennart

    Read the article

  • Django Encoding Issues with MySQL

    - by Jordan Reiter
    Okay, so I have a MySQL database set up. Most of the tables are latin1 and Django handles them fine. But, some of them are UTF-8 and Django does not handle them. Here's a sample table (these tables are all from django-geonames): DROP TABLE IF EXISTS `geoname`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `geoname` ( `id` int(11) NOT NULL, `name` varchar(200) NOT NULL, `ascii_name` varchar(200) NOT NULL, `latitude` decimal(20,17) NOT NULL, `longitude` decimal(20,17) NOT NULL, `point` point default NULL, `fclass` varchar(1) NOT NULL, `fcode` varchar(7) NOT NULL, `country_id` varchar(2) NOT NULL, `cc2` varchar(60) NOT NULL, `admin1_id` int(11) default NULL, `admin2_id` int(11) default NULL, `admin3_id` int(11) default NULL, `admin4_id` int(11) default NULL, `population` int(11) NOT NULL, `elevation` int(11) NOT NULL, `gtopo30` int(11) NOT NULL, `timezone_id` int(11) default NULL, `moddate` date NOT NULL, PRIMARY KEY (`id`), KEY `country_id_refs_iso_alpha2_e2614807` (`country_id`), KEY `admin1_id_refs_id_a28cd057` (`admin1_id`), KEY `admin2_id_refs_id_4f9a0f7e` (`admin2_id`), KEY `admin3_id_refs_id_f8a5e181` (`admin3_id`), KEY `admin4_id_refs_id_9cc00ec8` (`admin4_id`), KEY `fcode_refs_code_977fe2ec` (`fcode`), KEY `timezone_id_refs_id_5b46c585` (`timezone_id`), KEY `geoname_52094d6e` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; Now, if I try to get data from the table directly using MySQLdb and a cursor, I get the text with the proper encoding: >>> import MySQLdb >>> from django.conf import settings >>> >>> conn = MySQLdb.connect (host = "localhost", ... user = settings.DATABASES['default']['USER'], ... passwd = settings.DATABASES['default']['PASSWORD'], ... db = settings.DATABASES['default']['NAME']) >>> cursor = conn.cursor () >>> cursor.execute("select name from geoname where name like 'Uni%Hidalgo'"); 1L >>> g = cursor.fetchone() >>> g[0] 'Uni\xc3\xb3n Hidalgo' >>> print g[0] Unión Hidalgo However, if I try to use the Geoname model (which is actually a django.contrib.gis.db.models.Model), it fails: >>> from geonames.models import Geoname >>> g = Geoname.objects.get(name__istartswith='Uni',name__icontains='Hidalgo') >>> g.name u'Uni\xc3\xb3n Hidalgo' >>> print g.name Unión Hidalgo There's pretty clearly an encoding error here. In both cases the database is returning 'Uni\xc3\xb3n Hidalgo' but Django is (incorrectly?) translating the '\xc3\xb3n' to ó. What can I do to fix this?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >