encoding

how do I check the encoding of a file in visual studio 2010?

How can I check whether a file is encoded in UTF-8, ANSI, etc... in visual studio 2010? ...

Database charset conversion

Hi there. I've moved database from one host to another. I've used PMA to export and bigdump to import. The whole database have latin2 charset set everywhere where it's possible. However in database, special chars (polish ąęłó, etc.) are broken. When I used SELECT i see "bushes" - "Ä�" insetad of "ą". Then I've set document encoding to ...

convert digest to base10

Is it possible to take a digest created like my $digest = Digest::SHA->new('sha1')->add('hello')->digest; and then convert $digest to base10 (instead of hex or base64?) or could you split a hexdigest into 5 pieces and then convert those into integers? would that work? Trying to come up with a way to store the digest as integers (yes ...

How to code number in string and later decode it ?

I'm looking for encrypt/decrypt functions that will encode numbers (0, 1, 2, ...) into strings, such that these strings will look random, and later the number could be decodes back from the string. For example: 3 will be encrypted to ABFQWEMasdEE, and 6 will be encrypted to poad_Asd#@sad. If I could control the number of characters in ...

Convert unicode to ISO 8859-2 in .net

Hello, Im messing a lot with encoding stuff. I see UTF-8, Unicode, Latin, ISO, RTC, etc... But i dont understand the relation between them. How could i convert from Unicode to ISO 8859-2? Thanks in advance. Regards. ...

c#, Textbox.Text encoding

Hi! I have code: string text = sampleTextBox.Text; and I'm wondering in what encoding text is? Is it utf16 (as it is string) or maybe it is my operating system encoding? ...

XPath attribute quoting in JavaScript

I am trying to build a function that will properly quote/escape an attribute in XPath. I have seen solutions posted in C# here and here, but my implementation in JavaScript results in an error "This expression is not a legal expression" Here is my function: function parseXPathAttribute(original){ let result = null; ...

PHP: Fixing encoding issues with database content - removing accents from characters

Hi everyone, I'm trying to make a URL-safe version of a string. In my database I have a value medúlla - I want to turn this into medulla. I've found plenty of functions to do this, but when I retrieve the value from the database it comes back as medúlla. I've tried: Setting the column as utf_8 encoding Setting the table as utf_8 ...

SubSonic and MySql character encoding problem

I have a problem with character encoding when using subsonic (3.0.4) and mysql (5.1). I don't know how to specify ISO 8859-2/Latin2 encoding in SubSonic. ...

\n in NSSting * and .plist

Code: NSString *strDirect = @"Dummy\nMessage"; NSString *strBundle = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"MessageDummy"]; NSLog(@"Direct: %@", strDirect); NSLog(@"Bundle: %@", strBundle); where MessageDummy is a string type value Dummy\nMessage in the .plist file. i.e.: <key>MessageDummy</key> <string>Dummy\nMes...

Hebrew encoding in sql server2005

i try this code in sql server 2005 declare @userName nvarchar(50) set @userName='איש2' print @userName but i get this ???2 what is the cause? it look like it replace the Hebrew char to "?" 10x ...

PHP - character encoding

Is it possible to convert Aoibhín back to Aoibhín ? If it is how can it be done? Thanks in advance! ...

.NET XML unhelpfully resolves entities on Save

I have a simple XML file like so: <?xml version="1.0" encoding="UTF-8"?> <foo attr="blah &#176; blah"/> When I load it into the .NET XmlDocument and issue a Save, i.e.: xmlDoc = New XmlDocument() xmlDoc.Load("c:\temp\bar.xml") xmlDoc.Save("c:\temp\bad.xml") the new XML file contains the resolved amp 176 (a degree sign). This then b...

Strange special character encoding error

Hi, I have a very strange character encoding error: I am sending a textfield to a script via jQuerys ajax function. Assuming I want to send the euro sign echo $string; produces € however echo base64_decode(base64_encode($string)); produces € any hints on how I could debug this problem? ...

What's the difference between an "encoding," a "character set," and a "code page"?

I'm really trying to get better with this stuff. I'm pretty functional with internationalization concepts like this, but I need to get a better background on the theory behind it. I've read Spolsky's article, but I'm still unclear because these three terms get used interchangeably a LOT -- even in that article. I think at least two of...

curious case of hyphen and dash

I am trying to fetch records from Oracle 9i database whose value are 'FOO - BAR' for a particular column. The 'FOO - BAR' condition values are present in the table, But when I run the query, the results are not coming. After breaking my head for sometime, figured out that there is a difference in the size of the hypen's. 'FOO – BAR' ...

Converting a binary file to a string and vice versa

Hi, I created a webservice which returns a (binary) file. Unfortunately, I cannot use byte[] so I have to convert the byte array to a string. What I do at the moment is the following (but it does not work): Convert file to string: byte[] arr = File.ReadAllBytes(fileName); System.Text.UnicodeEncoding enc = new System.Text.UnicodeEnco...

mysql ’ show up as ’

Hi there, when I try and run: mysql -u myUser -pPassword -D myDatabase -h myHost < toInsert.sql from my ubuntu desktop where myHost is a remote Red Hat server and toInsert.sql contains ’ they show up as ’ How can I resolve this? Note! ’ is NOT the same as ' When I run toInsert.sql from a windows machine with a mysql gui client I ...

System.Text.Ecoding.UTF8.GetString is returning junk.

This is a tough one. I have a Response filter setup to transform the html before spitting back out to the browser (http://aspnetresources.com/articles/HttpFilters). This works fine on everyones machine but mine. Actually it was working on my machine until I had to do a hard reset because it locked up. public override void Write(byte[] ...

C# and HtmlAgilityPack encoding problem

WebClient GodLikeClient = new WebClient(); HtmlAgilityPack.HtmlDocument GodLikeHTML = new HtmlAgilityPack.HtmlDocument(); GodLikeHTML.Load(GodLikeClient.OpenRead("www.alfa.lt"); So this code returns: "Skaitytojo klausimas psichologui: kas lemia homoseksualumą? - Naujienų portalas Alfa.lt" instead of "Skaitytojo klausimas psichologui...