encoding

Using Ruby 1.9.1, how could I access this string's characters one at a time?

I don't know how else to explain, so I'll give you List of greek words with english derivatives. Look at the a table, please, first column. Notice there are words like ἄβαξ. Using Ruby 1.9.1, which has better encoding support than Ruby 1.8, how could I iterate over each character forming that word? For example, I'd like to get the letter...

Google maps - encoding individual waypoints

I am trying to build up a string which will link directly to the Google maps print view. e.g. http://maps.google.co.uk/maps?f=d&source=s_d&saddr=brixton&daddr=bath+to:bournemouth&hl=en&geocode=FUQ7EQMdyDr-_ym5RCh-QQR2SDGm1XOO93zFHA%3BFbQEEAMdMgfc_ykt4T50pnhxSDEJmm3W0CeLEw%3B&mra=ls&sll=51.75764,-1.241455&...

How to display encodeed string in a different language?

I am fetching directory name from a ftp server. This directory name is encoded. Now I want to display this directory name in a diffetnt language. Is it possible? If yes, please give me suggestion. ...

Preamble is empty for (new Utf8Encoding()).GetPreamble() - weird

Can anyone explain the difference between calling GetPreamble() on a newly instantiated utf8 encoding as opposed to the public ones available from the Encoding class? byte[] p1 = Encoding.UTF8.GetPreamble(); byte[] p2 = new UTF8Encoding().GetPreamble(); p1 is the normal 3 byte utf-8 preamble, but p2 ends up being empty, which seems ve...

Python Image Library produces a crappy quality jpeg when I resize a picture.

I use the Python Image Library (PIL) to resize an image and create a thumbnail. Why is it that my code produces an image that is so crappy and low-quality? Can someone tell me how to modify the code so that it's the highest quality JPEG? def create_thumbnail(buffer, width=100, height=100): im = Image.open(StringIO(buffer)) if im...

How to detect the usage rights (DRM) of a file

Suppose you have a .wma / .wmv file and you want to detect: is it DRM protected ? (then hopefully) details of the DRM protection (like when does the license expire etc.)? Is there a C# / C++ api for it? It seems that Windows Media Player can do it - if you click properties on that file... but Explorer does not show this info. Note:...

DES3 decryption in Ruby on Rails

My RoR server receives a string, that was encrypted in C++ application using des3 with base64 encoding The cipher object is created so: cipher = OpenSSL::Cipher::Cipher::new("des3") cipher.key = key_str cipher.iv = iv_str key_str and iv_str: are string representations of key and initialization vector for encryption algorithm. They a...

How to force a JSP to send the page in ISO-8859-1?

I wanted to send a page in ISO-8859-1 instead of UTF-8. The page is built with a JSP and some content retrieved by a CMS. I tried to put this in the JSP, but the navigator stills performs the page in UTF-8. grid.jsp: <%@page contentType="text/html; charset=iso-8859-1" pageEncoding="iso-8859-1"%> <html> <head> ...

Matching words in UTF-8 encoded string with Ruby 1.9.1

I want to match all individual words in given string, provided that String is UTF-8 encoded, and then I spellcheck each word. Everything works with my code provided it's english-only text, but if there are some, say, German characters, my words are split in two on these characters. How can I match single words from text, that contain lat...

encoding conversion tool

I would need some file encoding conversion tool, to convert some of my source files. I would need to do it as a batch, so the program needs to know to find out what's the source file encoding (Unicode - Codepage 1200) and save it as proper encoding (UTF-8), because project files are saved in different encodings. Can someone suggest me a ...

Determine input encoding

I'm getting console input from the user and want to encode it to UTF-8. My understanding is C++ does not have a standard encoding for input streams, and that it instead depends on the compiler, the runtime environment, localization, and what not. How can I determine the input encoding? ...

How can I properly align UTF-8 strings with Perl's printf?

Hello, what is the right way to get here a beautiful output ( all lines the same indent )? #!/usr/bin/env perl use warnings; use strict; use DBI; my $phone_book = [ [ qw( name number ) ], [ 'Kroner', 123456789 ], [ 'Holler', 123456789 ], [ 'Mühßig', 123456789 ], [ 'Singer', 123456789 ], ...

How do I enable FFMPEG logging and where can I find the FFMPEG log file?

I want to be able to log FFMPEG processes because I am trying to work out how long a minute of video takes to convert to help with capacity planning of my video encoding server. How do I enable logging and where is the log file saved. I have FFMPEG installed on a CentOS LAMP machine. ...

Voodoo magic interfering with my javascript, I am going crazy.

Alright, so everything on this website was finished, it all worked, it displayed right enough across all the browsers. For some reason one of the pages isn't styling at all, and the javascript isn't running. The crazy part about this is that every page uses the same CSS file and the same JS file, and the code used across all of them to i...

jndi encoding in url

i've the following in my context.xml <Resource name="jdbc/SomeDataSource" auth="Container" type="javax.sql.DataSource" username="foo" password="bar" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://localhost:1433/MyDatabase" initialSize="100" maxActive="500" maxIdle="50" min...

Jersey client not sending UTF-8 characters

Hi guys, We're using Jersey 1.0.3 to implement a REST client. This client needs to post an XML envelope containing UTF-8 characters. When debugging, we can clearly see that the entity that is being sent is correct. However, the request that is being sent changes the entity and garbles non-ASCII characters. We've dug into the Jersey sour...

how is the sarcmark implemented?

These people are selling a proprietary exclamation mark for sarcasm, and without going through the Unicode standardisation process, are proposing that it's possible to download this mark (in what format it's not completely clear), and use it in your written communications (to what extent it's not clear). My question is what exactly is be...

problems with sending non-english text over mail

I am trying to send non-english text over mail. The non-english text is on the "from" field of the mail (the text that appears beside the email address). In the recipient's mailbox, the non-english text is seen as a series of question marks. What could be wrong? Previously, I was having problems with printing non-english text from a sim...

What would someone have to know to build a GUI FLV Converter program for Windows?

Just have no idea from where to start to roll out my own flv conveter to convert video to flv from other formats. ...

Is it possible to assign ToolTip text (containing non-latin characters) in a Control Template of a WPF custom control?

In a WPF app I have a custom control. I would like the ToolTip for objects, derived from this custom control, depends on a value of one of the attributes of this custom control. Is it possible to declare it in a Control Template of this custom control? Something like: <ControlTemplate> ??? // <!--XAML ToolTip declaration --> ... <Con...