In .NET, I can use Encoding.UTF8.GetString(string str) or any other flavor of Encoding, to get the string representation of a byte array. Does Cocoa contain similar functionality out-of-the-box, or do I need to write some stuff to make the conversions myself?
...
I'm having trouble encoding accented characters in a URL using the python command line. Reducing my problem to the essential, this code:
>>> import urllib
>>> print urllib.urlencode({'foo' : raw_input('> ')})
> áéíóúñ
prints this in a mac command line:
foo=%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1
but the same code prints this in window...
Hi
I am using following versions of Ruby and Rails on arch linux
[hardik@sunshine: kandibank ]$ ruby --version
ruby 1.9.1p429 (2010-07-02 revision 28523) [x86_64-linux]
[hardik@sunshine: kandibank ]$ rails --version
Rails 2.3.8
I am using the sqllite database in development mode.
I can store a string having German special character...
Here is some code which I use to pull a text file into a UITextView called textView.
Because I can't always know the file's encoding ahead of time, I use the method -stringWithContentsOfFile:usedEncoding:error:, which stores an encoding value by reference.
Once I have the encoding, I then open up the file and, if there's an error, prin...
Hello,
I'm currently developing an application for iPhone and I would like to play a sound when the user touch a button.
When I use a .mp3 audio file, the sound plays on the simulator but won't on the device.
When I use a .tif audio file, it plays on both of them, but the quality isn't really good.
So my question is, is it possible th...
Hi,
I have a question on sending XML as string in a Webservice. One of our providers has developed a webservice that we should use. Their webservice is basically just a transport mechanism for their own request/response messages, e.g. class MyRequest is serialized to an XML string using JAXB passed to a setRequest method in their webser...
Most programming languages have some support for Unicode, but all have some more or less documented corner cases, where things won't work correctly.
Examples
Java:
reverse() in StringBuilder/StringBuffer work correctly. But length(), charAt(), etc. in String do not if a character needs more than 16bit to encode.
C#:
Didn't find a co...
Hi,
I am trying to read in some sentences from a file that contains unicode characters. It does print out a string but for some reason it messes up the unicode characters
This is the code I have:
public static String readSentence(String resourceName) {
String sentence = null;
try {
InputStream refStream = ClassLoader
...
I need to dynamically build a Regex to catch the given keywords, like
string regex = "(some|predefined|words";
foreach (Product product in products)
regex += "|" + product.Name; // Need to encode product.Name because it can include special characters.
regex += ")";
Is there some kind of Regex.Encode that does this?
...
I have a C#.net console application which reads data from a text file and updates it to the database. The file will have Scandinavian characters and other language characters. This is how I read the file in my app
using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
but this scrabled the output charcters
I tried usi...
Can FFmpeg encode video in VP8 codec? (I mean its trunk vercion)
...
I'm targeting a .NET application for the international market and need to implement mail sending functionality. I've noticed on the MailMessage class there are several options for setting encoding:
BodyEncoding
SubjectEncoding
HeadersEncoding
To, From address encoding
I have added a drop-down in the app's config page to choose the ma...
I'm studying Android push service (C2DM) for Android Froyo version.
The Google says the max size of message is 1024 bytes. (http://code.google.com/intl/ko/android/c2dm/)
What is the message encoding type? I want to put extra message which is not English.
...
I have built an index on my database rows (Each row as a document) which are of unicode type in MySQL(i.e. Charset: utf8 and Collation: utf8-bin). But When I search any word English or non-English it gives me no answers. It says:
0 total matching documents
My code is the demo code of lucene for search except that I have changed fie...
I basically follow the instructions in MSDN: http://msdn.microsoft.com/en-us/library/ms730299(VS.85).aspx
But when I try to invoke the web service, I get the error"
{"The content type text/xml of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure...
Good evening my dear programming gods!
I've been trying this for quite a while now, but can't figure it out :-(
I'm trying to export data to Excel via a *.csv file.
It works great so far, but I have some encoding problems when opening the files in Excel
(original string on the left, EXCEL result on the right):
Messwert(µm / m) ==> Mes...
Hi,
I am in doubt:
Or I abstract away my string-type and implicitly use the local stringtype or I use something like ICU and convert to the local type when needed.
Let me give you an example the following:
enum StringKind {
ICU_STRING,
STD_STRING,
MSCORLIB_STRING,
NSSTRING,
... /* You get the picture */
};
template<class E...
I'm working with a binary protocol that uses LLV to encode some variables.
I was given an example below which is used to specify a set of 5 chars to display.
F1 F0 F5 4C 69 6E 65 31
the F1 is specific to my device, it indicates display text on line one. The f0 and f5 I'm not sure about, the rest looks like ASCII text.
Anyone know h...
Hi, I have problems with special characters in soap responses.
All connections are made in utf-8 (in xml headers, SoapClient configuration, php source code, database connections, soap server responses) and I don't understand what is happening.
All special characters are replaced with a sharp "#" character.
For example:
Instead of "Sól...
I need to send a public key created by RSA by SMS to another phone.
I am converting the 148 byte public key to base64 to be sent by SMS. But it increases the 148 bytes to 200 bytes when converted.
As byte[] cannot be directly sent by SMS, what are the other possible methods of converting them successfully to strings or equivalent which ...