Search Results

Search found 36172 results on 1447 pages for 'unicode string'.

Page 40/1447 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • binary_search not working for a vector<string>

    - by VaioIsBorn
    #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(void) { string temp; vector<string> encrypt, decrypt; int i,n, co=0; cin >> n; for(i=0;i<n;i++) { cin >> temp; encrypt.push_back(temp); } for(i=0;i<n;i++) { cin >> temp; decrypt.push_back(temp); } for(i=0;i<n;i++) { temp = encrypt[i]; if((binary_search(decrypt.begin(), decrypt.end(), temp)) == true) ++co; } cout << co << endl; return 0; } It reads two equal lists of strings and should print out how many of the words in the first list are also found in the second list, simple. Not giving me the expexted results and i think the problem is in binary_search. Can you tell me why ?

    Read the article

  • Exercise for exam about comparing string on file

    - by Telmo Vaz
    I'm trying to do this exercise for my exam tomorrow. I need to compare a string of my own input and see if that string is appearing on the file. This needs to be done directly on the file, so I cannot extract the string to my program and compare them "indirectly". I found this way but I'm not getting it right, and I don't know why. The algorithm sounds good to me. Any help, please? I really need to focus on this one. Thanks in advance, guys. #include<stdio.h> void comp(); int main(void) { comp(); return 0; } void comp() { FILE *file = fopen("e1.txt", "r+"); if(!file) { printf("Not possible to open the file"); return; } char src[50], ch; short i, len; fprintf(stdout, "What are you looking for? \nwrite: "); fgets(src, 200, stdin); len = strlen(src); while((ch = fgetc(file)) != EOF) { i = 0; while(ch == src[i]) { if(i <= len) { printf("%c - %c", ch, src[i]); fseek(file, 0, SEEK_CUR + 1); i++; } else break; } } }

    Read the article

  • XSLT: replace an integer by a string

    - by binogure
    I have a little problem. A node in my XML may contains and integer, and i have to replace this integer by a string. Each number match with a string. For example i have: Integer - String 1 - TODO 2 - IN PROGRESS 3 - DONE 4 - ERROR 5 - ABORTED Original XML: <root> <status>1</status> </root> Converted XML: <root> <status>TODO</status> </root> So i want replace 1 by "TODO", 2 by "IN PROGRESS" ... <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/root/status"> <root> <status> <xsl:variable name="text" select="." /> <xsl:choose> <xsl:when test="contains($text, '1')"> <xsl:value-of select="'TODO'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> </status></root> </xsl:template> </xsl:stylesheet> I'am asking if there is another way to do that.

    Read the article

  • javascript error of unterminated string

    - by OM The Eternity
    I want pass a parameter of javascript functiona which is a string. This javascript function is a hintbox on mousehover.. and the string i am using is like this: Hemmed Finish: Every side/edge (1/2" to 2") of the banner are folded and glued (special vinyl solution) or heat pressed. This is the most common and best finish option. Stitched Finish: Every side/edge (1" to 2") of the banner are folded in the back and stitched/sewed with white thread. This is not a common option as thread can be seen on the banner. Now in the hintbox on mousehover the above given text has to be display as it is displayed above along with the paragraph break.. But when i pass the above as parameter in that function along with appending some backslashes to recognise some punctuation, iots till gives me javascript error of unterminated string... I am doing this: onMouseover="showhint('Hemmed Finish\: Every side/edge \(1/2\'\' to 2\'\'\) of the banner are folded and glued \(special vinyl solution\) or heat pressed. This is the most common and best finish option.Stitched Finish\: Every side/edge \(1\'\' to 2\'\'\) of the banner are folded in the back and stitched/sewed with white thread. This is not a common option as thread can be seen on the banner', this, event, '250px')" pls could u help me in rectifying the issue...

    Read the article

  • finding long repeated substrings in a massive string

    - by Will
    I naively imagined that I could build a suffix trie where I keep a visit-count for each node, and then the deepest nodes with counts greater than one are the result set I'm looking for. I have a really really long string (hundreds of megabytes). I have about 1 GB of RAM. This is why building a suffix trie with counting data is too inefficient space-wise to work for me. To quote Wikipedia's Suffix tree: storing a string's suffix tree typically requires significantly more space than storing the string itself. The large amount of information in each edge and node makes the suffix tree very expensive, consuming about ten to twenty times the memory size of the source text in good implementations. The suffix array reduces this requirement to a factor of four, and researchers have continued to find smaller indexing structures. And that was wikipedia's comments on the tree, not trie. How can I find long repeated sequences in such a large amount of data, and in a reasonable amount of time (e.g. less than an hour on a modern desktop machine)? (Some wikipedia links to avoid people posting them as the 'answer': Algorithms on strings and especially Longest repeated substring problem ;-) )

    Read the article

  • PHP – Slow String Manipulation

    - by Simon Roberts
    I have some very large data files and for business reasons I have to do extensive string manipulation (replacing characters and strings). This is unavoidable. The number of replacements runs into hundreds of thousands. It's taking longer than I would like. PHP is generally very quick but I'm doing so many of these string manipulations that it's slowing down and script execution is running into minutes. This is a pain because the script is run frequently. I've done some testing and found that str_replace is fastest, followed by strstr, followed by preg_replace. I've also tried individual str_replace statements as well as constructing arrays of patterns and replacements. I'm toying with the idea of isolating string manipulation operation and writing in a different language but I don't want to invest time in that option only to find that improvements are negligible. Plus, I only know Perl, PHP and COBOL so for any other language I would have to learn it first. I'm wondering how other people have approached similar problems? I have searched and I don't believe that this duplicates any existing questions.

    Read the article

  • How to manipulate string to delete quotes?

    - by user1751581
    I am trying to manipulate a string so that any quotes (") within <a href> and <\a> get taken out... Sorry if its been asked before but I just can't get it to work! By the way, I am POSTing the data from a form and then manipulating the string. This is basically html but its in the form of a string, and I want to take out quotes on things like images and links... Another thing is, I do not want to escape the quotes because that would break the link... And the whole point is that the html can be used and work fine... But now, something is automatically creating a second set of quotes inside the normal quotes, like this: <a href="\"http://www.example.com/\""></a> Example input would be: <p><a href="http://www.example.com">example</a></p> Heres how it appears when I echo it however: <p><a href=\"http://www.example.com\">example</a></p> Heres how I want it to look: <p><a href="http://www.example.com">example</a></p> So I would actually be trying to get rid of the (/) my bad...

    Read the article

  • Good C string libary

    - by chamakits
    Hello all. I recently got inspired to start up a project I've been wanting to code for a while. I want to do it in C, because memory handling is key this application. I was searching around for a good implementation of strings in C, since I know me doing it myself could lead to some messy buffer overflows, and I expect to be dealing with a fairly big amount of strings. I found this article which gives details on each, but they each seem like they have a good amount of cons going for them (don't get me wrong, this article is EXTREMELY helpful, but it still worries me that even if I were to choose one of those, I wouldn't be using the best I can get). I also don't know how up to date the article is, hence my current plea. What I'm looking for is something that may hold a large amount of characters, and simplifies the process of searching through the string. If it allows me to tokenize the string in any way, even better. Also, it should have some pretty good I/O performance. Printing, and formatted printing isn't quite a top priority. I know I shouldn't expect a library to do all the work for me, but was just wandering if there was a well documented string function out there that could save me some time and some work. Any help is greatly appreciated. Thanks in advance! EDIT: I was asked about the license I prefer. Any sort of open source license will do, but preferably GPL (v2 or v3). EDIt2: I found betterString (bstring) library and it looks pretty good. Good documentation, small yet versatile amount of functions, and easy to mix with c strings. Anyone have any good or bad stories about it? The only downside I've read about it is that it lacks Unicode (again, read about this, haven't seen it face to face just yet), but everything else seems pretty good. EDIT3: Also, preferable that its pure C.

    Read the article

  • String generator issue

    - by Andrey
    I want to write a method which returns a string. So far so good. The creation of the string however is quite complicated. I have 3 string lists - the first one has 155 entries, the second one - 9, the third one 21. I want my method if called enough times(155*9*21) to return all the possible combinations of values from the 3 lists (basically this method should keep count on how many times it was called and return only one combination each time). Any ideas how to accomplish that? I have 155*9*22 possible combinations. The first time the method is called it should take List1(0), List2(0), List3(0). After that in the next 21 iterations, the index of the third list is only changed. Once all the elements from the third list have been used increment the index of the second list and so on. Once the method has produced all the possible combinations (155*9*22) I want it to start from the beginning.

    Read the article

  • Length of a string in pixels

    - by Rose
    Guys, I'm populating a dropDownList with arrayCollection of strings. I want the width of the drop down list control to match with the size (in pixels) of the longest string in the array collection. The problem I'm facing is: the font width of the strings in the collection are different e.g. 'W' looks wider than 'l'. So I estimated the width of a character to be 8 pixels but that's not pretty neat. If a string that has many 'W' and 'M' is encountered the estimation is wrong. So I want precise pixel width of strings. How can i get the exact length of a string in pixels?? My solution that estimates all character to be 8 pixels wide is given below: public function populateDropDownList():void{ var array:Array = new Array("o","two","three four five six seven eight wwww"); var sampleArrayCollection:ArrayCollection = new ArrayCollection(array); var customDropDownList:DropDownList = new DropDownList(); customDropDownList.dataProvider=sampleArrayCollection; customDropDownList.prompt="Select ..."; customDropDownList.labelField="Answer Options:"; //calculating the max width var componentWidth=10; //default for each(var answerText in array){ Alert.show("Txt size: "+ answerText.length + " pixels: " + answerText.length*9); if(answerText.length * 8 > componentWidth){ componentWidth=answerText.length * 8; } } customDropDownList.width=componentWidth; answers.addChild(customDropDownList); } Any idea or solution is highly valued. Thanks

    Read the article

  • Maximum length of a std::basic_string<_CharT> string

    - by themoondothshine
    Hey all, I was wondering how one can fix an upper limit for the length of a string (in C++) for a given platform. I scrutinized a lot of libraries, and most of them define it arbitrarily. The GNU C++ STL (the one with experimental C++0x features) has quite a definition: size_t npos = size_t(-1); /*!< The maximum value that can be stored in a variable of type size_t */ size_t _S_max_len = ((npos - sizeof(_Rep_base))/sizeof(_CharT) - 1) / 4; /*!< Where _CharT is a template parameter; _Rep_base is a structure which encapsulates the allocated memory */ Here's how I understand the formula: The size_t type must hold the count of units allocated to the string (where each unit is of type _CharT) Theoretically, the maximum value that a variable of type size_t can take on is the total number of units of 1 byte (ie, of type char) that may be allocated The previous value minus the overhead required to keep track of the allocated memory (_Rep_base) is therefore the maximum number of units in a string. Divide this value by sizeof(_CharT) as _CharT may require more than a byte Subtract 1 from the previous value to account for a terminating character Finally, that leave the division by 4. I have absolutely no idea why! I looked at a lot of places for an explanation, but couldn't find a satisfactory one anywhere (that's why I've been trying to make up something for it! Please correct me if I'm wrong!!).

    Read the article

  • C Map String to Function

    - by Scriptonaut
    So, I'm making a Unix minishell, and have come to a roadblock. I need to be able to execute built-in functions, so I made a function: int exec_if_built_in(char **args) It takes an array of strings(the first being the command, and the rest being arguments). For non built-in commands I simply use something like execvp, however I need to find a way to map the first string to a function. I was thinking of making two arrays, one of strings, and another with their corresponding function pointers. However, since many of these functions will be different(return and accept different things), this approach won't work. I also thought of making an array of structs with a name property and a function pointer property, however once again due to the varied nature of the functions I'll be using, this won't work. So, what's the best way to execute a function based on the input of a string? How do I map a string to a certain function? I'm not very familiar with function pointers so I may be missing something. Thank you guys for the help :)

    Read the article

  • Parsing string based on initial format

    - by Kayla
    I'm trying to parse a set of lines and extract certain parts of the string based on an initial format (reading a configuration file). A little more explanation: the format can contain up to 4 parts to be formatted. This case, %S will skip the part, %a-%c will extract the part and will be treated as a string, %d as int. What I am trying to do now is to come up with some clever way to parse it. So far I came up with the following prototype. However, my pointer arithmetic still needs some work to skip/extract the parts. Ultimately each part will be stored on an array of structs. Such as: struct st_temp { char *parta; char *partb; char *partc; char *partd; }; ... #include <stdio.h> #include <string.h> #define DIM(x) (sizeof(x)/sizeof(*(x))) void process (const char *fmt, const char *line) { char c; const char *src = fmt; while ((c = *src++) != '\0') { if (c == 'S'); // skip part else if (c == 'a'); // extract %a else if (c == 'b'); // extract %b else if (c == 'c'); // extract %c else if (c == 'd'); // extract %d (int) else { printf("Unknown format\n"); exit(1); } } } static const char *input[] = { "bar 200.1 / / (zaz) - \"bon 10\"", "foo 100.1 / / (baz) - \"apt 20\"", }; int main (void) { const char *fmt = "%S %a / / (%b) - \"%c %d\""; size_t i; for(i = 0; i < DIM (input); i++) { process (fmt, input[i]); } return (0); }

    Read the article

  • What Regex can strip e.g. "note:" and "firstName: " from the left of a string?

    - by Edward Tanguay
    I need to strip the "label" off the front of strings, e.g. note: this is a note needs to return: note and this is a note I've produced the following code example but am having trouble with the regexes. What code do I need in the two ???????? areas below so that I get the desired results shown in the comments? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace TestRegex8822 { class Program { static void Main(string[] args) { List<string> lines = new List<string>(); lines.Add("note: this is a note"); lines.Add("test: just a test"); lines.Add("test:\t\t\tjust a test"); lines.Add("firstName: Jim"); //"firstName" IS a label because it does NOT contain a space lines.Add("She said this to him: follow me."); //this is NOT a label since there is a space before the colon lines.Add("description: this is the first description"); lines.Add("description:this is the second description"); //no space after colon lines.Add("this is a line with no label"); foreach (var line in lines) { Console.WriteLine(StringHelpers.GetLabelFromLine(line)); Console.WriteLine(StringHelpers.StripLabelFromLine(line)); Console.WriteLine("--"); //note //this is a note //-- //test //just a test //-- //test //just a test //-- //firstName //Jim //-- // //She said this to him: follow me. //-- //description //this is the first description //-- //description //this is the first description //-- // //this is a line with no label //-- } Console.ReadLine(); } } public static class StringHelpers { public static string GetLabelFromLine(this string line) { string label = line.GetMatch(@"^?:(\s)"); //??????????????? if (!label.IsNullOrEmpty()) return label; else return ""; } public static string StripLabelFromLine(this string line) { return ...//??????????????? } public static bool IsNullOrEmpty(this string line) { return String.IsNullOrEmpty(line); } } public static class RegexHelpers { public static string GetMatch(this string text, string regex) { Match match = Regex.Match(text, regex); if (match.Success) { string theMatch = match.Groups[0].Value; return theMatch; } else { return null; } } } }

    Read the article

  • How do you tell if two wildcards overlap?

    - by Tom Ritter
    Given two strings with * wildcards, I would like to know if a string could be created that would match both. For example, these two are a simple case of overlap: Hello*World Hel* But so are all of these: *.csv reports*.csv reportsdump.csv Is there an algorithm published for doing this? Or perhaps a utility function in Windows or a library I might be able to call or copy?

    Read the article

  • Beautify Integer values for comparing as strings

    - by Zahra
    Hi. For some reason I need to enter my integer values to database as string, then I want to run a query on them and compare those integers as strings. Is there any way to beautify integer numbers (between 1 and 1 US billion as an example) so I can compare them as strings? Thanks in advance.

    Read the article

  • Regex: Match any character (including whitespace) except a comma

    - by selecsosi
    I would like to match any character and any whitespace except comma with regex. Only matching any character except comma gives me: [^,]* but I also want to match any whitespace characters, tabs, space, newline, etc. anywhere in the string. For example, I would like to be able to match all of this up until the comma: "bla bla bla" "asdfasdfasdfasdfasdfasdf" "asdfasdfasdf", Is there a simple way to do this without knowing where the whitespace may be?

    Read the article

  • How can I map a String to a function in Java?

    - by Bears will eat you
    Currently, I have a bunch of Java classes that implement a Processor interface, meaning they all have a processRequest(String key) method. The idea is that each class has a few (say, <10) member Strings, and each of those maps to a method in that class via the processRequest method, like so: class FooProcessor implements Processor { String key1 = "abc"; String key2 = "def"; String key3 = "ghi"; // and so on... String processRequest(String key) { String toReturn = null; if (key1.equals(key)) toReturn = method1(); else if (key2.equals(key)) toReturn = method2(); else if (key3.equals(key)) toReturn = method3(); // and so on... return toReturn; } String method1() { // do stuff } String method2() { // do other stuff } String method3() { // do other other stuff } // and so on... } You get the idea. This was working fine for me, but now I need a runtime-accessible mapping from key to function; not every function actually returns a String (some return void) and I need to dynamically access the return type (using reflection) of each function in each class that there's a key for. I already have a manager that knows about all the keys, but not the mapping from key to function. My first instinct was to replace this mapping using if-else statements with a Map<String, Function>, like I could do in Javascript. But, Java doesn't support first-class functions so I'm out of luck there. I could probably dig up a third-party library that lets me work with first-class functions, but I haven't seen any yet, and I doubt that I need an entire new library. I also thought of putting these String keys into an array and using reflection to invoke the methods by name, but I see two downsides to this method: My keys would have to be named the same as the method - or be named in a particular, consistent way so that it's easy to map them to the method name. This seems WAY slower than the if-else statements I have right now. Efficiency is something of a concern because these methods will tend to get called pretty frequently, and I want to minimize unnecessary overhead. TL; DR: I'm looking for a clean, minimal-overhead way to map a String to some sort of a Function object that I can invoke and call (something like) getReturnType() on. I don't especially mind using a 3rd-party library if it really fits my needs. I also don't mind using reflection, though I would strongly prefer to avoid using reflection every single time I do a method lookup - maybe using some caching strategy that combines the Map with reflection. Thoughts on a good way to get what I want? Cheers!

    Read the article

  • the font of xubuntu

    - by ubuntu
    HI: How to set the default font for different language in the xubuntu? For example, I am using xubuntu9.10(English release),and I do not like the default English and Chinese font. I have tried to use "Application-setting-appearance-fonts" to edit the default font,however it just work for the English. The default font of Chinese is "WenQuanYi Zen Hei". I do not like it. I want to use "Microsoft YaHei", I copy this file from my Win7 system. And I tried remove the "WenQuanYi Zen Hei" by "sudo aptitude remove ttf-wqy",it show me it is successfully removed. Also I have modify the file: /etc/fonts/conf.avail/69-language-selector-zh-cn.conf to: <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans</string> <string>Microsoft YaHei</string> <string>DejaVu Sans</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans Mono</string> <string>Microsoft YaHei</string> <string>DejaVu Sans Mono</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig> However when I use the firefox, I found the title of the firefox window is not YaHei. See the image here So what is the problem?

    Read the article

  • the font of xubuntu

    - by ubuntu
    HI: How to set the default font for different language in the xubuntu? For example, I am using xubuntu9.10(English release),and I do not like the default English and Chinese font. I have tried to use "Application-setting-appearance-fonts" to edit the default font,however it just work for the English. The default font of Chinese is "WenQuanYi Zen Hei". I do not like it. I want to use "Microsoft YaHei", I copy this file from my Win7 system. And I tried remove the "WenQuanYi Zen Hei" by "sudo aptitude remove ttf-wqy",it show me it is successfully removed. Also I have modify the file: /etc/fonts/conf.avail/69-language-selector-zh-cn.conf to: <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans</string> <string>Microsoft YaHei</string> <string>DejaVu Sans</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans Mono</string> <string>Microsoft YaHei</string> <string>DejaVu Sans Mono</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig> However when I use the firefox, I found the title of the firefox window is not YaHei. See the image here So what is the problem?

    Read the article

  • How to retain XML string as a string field during XML deserialization

    - by detale
    I got an XML input string and want to deserialize it to an object which partially retain the raw XML. <SetProfile> <sessionId>A81D83BC-09A0-4E32-B440-0000033D7AAD</sessionId> <profileDataXml> <ArrayOfProfileItem> <ProfileItem> <Name>Pulse</Name> <Value>80</Value> </ProfileItem> <ProfileItem> <Name>BloodPresure</Name> <Value>120</Value> </ProfileItem> </ArrayOfProfileItem> </profileDataXml> </SetProfile> The class definition: public class SetProfile { public Guid sessionId; public string profileDataXml; } I hope the deserialization syntax looks like string inputXML = "..."; // the above XML XmlSerializer xs = new XmlSerializer(typeof(SetProfile)); using (TextReader reader = new StringReader(inputXML)) { SetProfile obj = (SetProfile)xs.Deserialize(reader); // use obj .... } but XMLSerializer will throw an exception and won't output < profileDataXml 's descendants to "profileDataXml" field in raw XML string. Is there any way to implement the deserialization like that?

    Read the article

  • Storing and displaying unicode string (??????) using PHP and MySQL

    - by Anirudh Goel
    I have to store hindi text in a MySQL database, fetch it using a PHP script and display it on a webpage. I did the following: I created a database and set its encoding to UTF-8 and also the collation to utf8_bin. I added a varchar field in the table and set it to accept UTF-8 text in the charset property. Then I set about adding data to it. Here I had to copy data from an existing site. The hindi text looks like this: ????????:05:30 I directly copied this text into my database and used the PHP code echo(utf8_encode($string)) to display the data. Upon doing so the browser showed me "??????". When I inserted the UTF equivalent of the text by going to "view source" in the browser, however, ???????? translates into &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351;. If I enter and store &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351; in the database, it converts perfectly. So what I want to know is how I can directly store ???????? into my database and fetch it and display it in my webpage using PHP. Also, can anyone help me understand if there's a script which when I type in ????????, gives me &#2360;&#2370;&#2352;&#2381;&#2351;&#2379;&#2342;&#2351;? Solution Found I wrote the following sample script which worked for me. Hope it helps someone else too <html> <head> <title>Hindi</title></head> <body> <?php include("connection.php"); //simple connection setting $result = mysql_query("SET NAMES utf8"); //the main trick $cmd = "select * from hindi"; $result = mysql_query($cmd); while ($myrow = mysql_fetch_row($result)) { echo ($myrow[0]); } ?> </body> </html> The dump for my database storing hindi utf strings is CREATE TABLE `hindi` ( `data` varchar(1000) character set utf8 collate utf8_bin default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `hindi` VALUES ('????????'); Now my question is, how did it work without specifying "META" or header info? Thanks!

    Read the article

  • What is adding frog characters to my URLs?

    - by Jacob Hume
    While browsing the "Crawl Errors" section of Google Webmaster Tools, I discovered a set of very strange 500 errors in reference to my site: I was able to track down what these characters are, and apparently they are the first two characters in the Unicode Private Use Area. My font just happened to map them to a frog wearing a tiny crown, and a symbol that resembles the numeral 7. These symbols only appear on the addresses of non-HTML files; office documents, PDFs, etc. - but they do not just appear in the file name. Where are these symbols coming from, and is there any way I can get rid of them so Google can properly crawl my site? Some background information: Using Web Server running WS2K3 with IIS6 and PHP 5.3.8 Site encoding is UTF-8 These symbols don't appear on the page, or in the source

    Read the article

  • Fastest way to access VB6 String in C#

    - by Simon Woods
    Hi I am using COMInterop. I have a call in VB6 which returns a string of roughly 13000 chars. If I execute the call in pure VB6 it takes about 800ms to execute. If I execute it via c# and COMInterop it takes about 8 seconds. I'm assuming the delay is caused by marshalling. If I am correct about marshalling, I'd be grateful if someone could suggest the fastest way I can get this into C#. e.g. Would it be better to a) expose it as a byte array b) provide a byref string param into the VB6 layer I would appreciate some sample code as well. I tried the Marshal.PtrToStringAuto(Marshal.ReadIntPtr(myCOMObject.GetString, 0) to no avail Many thx S

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >