unicode

How to redirect to a query string URL containing non-ascii characters in DJANGO?

How to redirect to a query string URL containing non-ascii characters in DJANGO? When I use "return HttpResponseRedirect(u'/page/?title=' + query_string)" where the query_string contains characters like "你好", I get an error "'ascii' codec can't encode characters in position 21-26: ordinal not in range(128), HTTP response headers must be...

JavaScipt: Unicode space character

I want to insert the space character into the innerHTML of a DOM element, but the space character must be declare in unicode syntax. For exxample, something like this: ...innerHTML += '\u83838383'; ...

Print string in a form of Unicode codes

How can I print a string as a sequence of unicode codes in Python? Input: "если" (in Russian). Output: "\u0435\u0441\u043b\u0438" ...

Is there any way to write Hebrew in the Windows Console?

Is there any way to write Hebrew in the Windows Console? I tried the following: Console.OutputEncoding = new UTF8Encoding(false); Console.WriteLine("\u05D0\u05D1"); Console.ReadLine(); but instead of "אב" it writes some other Unicode character, that're not in the Hebrew ABC. Any ideas why? ...

Problem rendering non-English unicode text using freetype font on OpenGL

I am currently following NeHe tutorial lesson 43 ( http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43). The code works satisfactorily only for English text, not Unicoded languages. Fortunately, I follow a link from NeHe lesson 43 to http://www.cs.northwestern.edu/~sco590/fonts_tutorial.html and found another identical tutorial sam...

UnicodeEncodeError when redirecting stdout

I'm having a problem regarding Unicode in Python. I can print the output fine in a regular terminal, but if I redirect stdout elsewhere (or capture it with the subprocess module), I get a UnicodeEncodeError: $ cat example.py print u'Example: \u00F1' $ python example.py Example: ñ $ python example.py > /dev/null Traceback (most recent ...

What's the unicode glyph used to indicate combining characters?

My application needs to display "orphaned" combining characters. I would like to use the same format as the "official" unicode charts, using the dotted circle placeholder. See, for example: Combining Diacritical Marks (PDF) A quick scan through the charts and I came up with U+25CC "DOTTED CIRCLE". That looks good, but the note on thi...

SendInput sequence to create unicode character fails.

I'm working with an on-screen keyboard that needs to send key strokes to a third party application. They are running on Windows XP. A small set of characters that are not available on the US English keyboard need to be supported (such as "å" or ñ). After reviewing SendInput it seemed like the safest thing would be to send the hex unicode...

case-insensitive comparison of two TCHAR's

What is a good way to compare two individual characters (either char or UTF-16 wchar_ts) ignoring case? A trivial implementation would be upper- or lowercasing both. Is one of these considered better, or are there other methods? I understand that a completely correct comparison is not possible with all details of Unicode. The comparis...

Unicode vs Multi-byte

I'm really confused by this unicode vs multi-byte thing. Say I'm compiling my program in Unicode (but ultimately, I want a solution that is independent of the character set used). 1) Will all 'char' be interpreted as wide characters? 2) If I have a simple printf statement, i.e. printf("Hello World\n"); with no character strings, can I...

Converting from ANSI to Unicode

Hi all, I'm using Visual Studio .NET 2003, and I'm trying to convert a program written in purely ANSI characters to be independent of Unicode/Multi-byte characters. The program has a callback function of pcap_loop, called "got_packet". It's defined as void got_packet(u_char *user, const struct pcap_pkthdr *header, const u_char *cpacke...

Using unicode in Python

Hello, I have csv file having some address data mostly in Finnish language. I need to read that file and getting some geocode information of these address. But It doesn't work for Finnish alphabet and says it cant read those! Can anybody please help me out of this? import urllib,urllib2,time addr_file = 'address.csv' out_file = 'addres...

How to extract English text from pdf where English and Japanese mixed

Hello. I have a set of pdf reports with similar information. Among other information in these reports stored few important for me fields which I need to find and extract. For example: Name: John Smith Date of Visit: 01.02.10 For English, French, German and few other languages I simply parse pdf and extract all "(Bla-bla)Tj" occurences...

Using Unicode with PHP

How do I use Unicode with PHP? I want to store Unicode value in a PHP variable but it output some question marks. What is the solution? ...

C programming, unicode and the linux terminal

So what I'm trying to do is write Japanese characters to my terminal screen using C and wide characters. The question is whats wrong with what I'm doing so that I can fix it, what other caveats should I expect while using wide characters and do you have any other comments about what I'm trying to do? The bad code: #include <stdio....

Where can I get started with Unicode-friendly programming in C?

So, I’m working on a plain-C (ANSI 9899:1999) project, and am trying to figure out where to get started re: Unicode, UTF-8, and all that jazz. Specifically, it’s a language interpreter project, and I have two primary places where I’ll need to handle Unicode: reading in source files (the language ostensibly supports Unicode identifiers a...

Unicode parsing problem using json.loads

Hi What is the best way to load JSON string in Python. Here is my code which give problem for loading json strings... import json json.loads(str_to_load) I also tried supplying 'encoding' parameter with value 'utf-16', but that didn't work either... Can you please help me solve this problem? Thanks ...

Open a SHIFT_JIS file in Ruby 1.8.7

This is one of those things that seems like it should be laughably easy but I'm stuck... I need to open a CSV file that is stored in SHIFT_JIS encoding and decode it to Unicode and also encode in UTF-8. It sounds like this is pretty straightforward in ruby 1.9 but I'm not feeling particularly adventurous on my production Rails app, so I...

String.getBytes("ISO-8859-1") gives me 16-bit characters on OS X

Using Java 6 to get 8-bit characters from a String: System.out.println(Arrays.toString("öä".getBytes("ISO-8859-1"))); gives me, on Linux: [-10, 28] but OS X I get: [63, 63, 63, -89] I seem get the same result when using the fancy new nio CharSetEncoder class. What am I doing wrong? Or is it Apple's fault? :) ...

How do I properly work with unicode characters in python to keep from getting errors?

I'm working on a python plugin for Google Quick Search Box, and it's doing some odd things with non-ascii characters. It seems like the code works fine up until I try constructing a string containing the non-ascii characters (ü has been my test character). I am using the following code snippet for the construction, with new_task as the v...