character-encoding

Using Tidy to clean HTML, HTML content is being changed, encoding problem?

I am fetching HTML from a smarty template and need to clean it (simply want to remove extra whitespace, and format / indent the HTML nicely), I'm using tidy to do something like: $html = $smarty->fetch('foo.tmpl'); $tidy = new tidy; $tidy->parseString($html, array( 'hide-comments' => TRUE, 'output-xhtml' => TRUE, 'indent'...

Codec Errors in Python

Does anyone know the name of a codec that can translate any random assortment of bytes into a string? I have been getting the following error after encoding, encrypting, and decoding a string in tkinter.Text. UnicodeDecodeError: 'utf8' codec can't decode byte 0x99 in position 151: unexpected code byte Code used to generate the error f...

Request a resource with percent sign in path

I need to request a file www.myserver.de/file%.pdf . The file exists and requesting the renamed copy www.myserver.de/file.pdf works. Is this expected behaviour? ...

Add TM to text with jQuery?

I need a way to go through all the text on my page, including links and other controls and find words that are in a certain list and add the html character entity ™ () to them. I need this to be fast too. The list is held in a javascript array. I've already got code using .each to find all Links on the page with text from that lis...

Should explicit character encoding and encoding/decoding be promoted as a "best practice" in Perl?

I previously only had vague awareness of character encoding issues, but answers to a question today got me thinking about it. The following provided more food for thought too: perlunitut - Perl Unicode Tutorial perlunifaq - Perl Unicode FAQ The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode a...

Wrong character encoding in dist jar generated with NetBeans

Hi, I finally wrote me little app. It's desktop app but it has embedded web server. When I lunched it from NetBeans everything is ok. When I lunch dist jar I have correct character encoding in GUI, but web server output is corrupted ("?" instead of national characters). I use NetBeans 6.7.1, jdk1.6.0_16, http server from Java 6 SE and ...

Greasemonkey communication with server that requires windows-1250 encoding

I'm developing a greasemonkey plugin, which is supposed to send a form in background using POST (GM_xmlhttpRequest) on an application not under my control. That application is written in PHP and seems to expect all its input in windows-1250 encoding. What I need to do is to take all the form fields as they are, edit just one of them and ...

How to detact the encoding using mb_detect_encoding correct?

I want to detect encoding correct, but i found mb_detect_encoding always get error result, And I added lots of encoding_list UTF8 ISO-8859-* .... ...

Change encoding of HttpServletResponse

Hi, I have an API that returns XML, it actually returns it using the default encoding (I believe it's UTF-8), but now requirements have changed and we need to return everything in UTF-16LE. My question is: is there an easy way of doing this? I have access to the response just before the calls complete so I was wondering if I could do s...

Why do Excel and IE8 give an error when viewing XML with an ë in it?

Maybe this is an encoding issue? I can't imagine that you have to replace every non standard character. Example XML: <?xml version="1.0" encoding="utf-8"?> <client> <achternaam>Erriëns</achternaam> </client> With or without the first line doesn't matter. Error in IE8: The XML page cannot be di...

Character encoding problem in PHP and MySQL

When I run a query directly in MySQL using phpMyAdmin it allows – (long dash, not normal -), but when I run this query from my PHP code, it turns them to –. If you encode – it'll come %E2%80%93 (in JavaScript). %E2 becomes â, %80 becomes € and %93 becomes “. I don't understand when I run the query in phpMyAdmin it shaves data as –, bu...

C++ Visual Studio character encoding issues

Not being able to wrap my head around this one is a real source of shame... I'm working with a French version of Visual Studio (2008), in a French Windows (XP). French accents put in strings sent to the output window get corrupted. Ditto input from the output window. Typical character encoding issue, I enter ANSI, get UTF-8 in return, o...

Flash, JSON and special chars, how read òàùèéì on flash with JSON?

Hello, I've a problem loading a JSON with flash class com.adobe.serialization.json.JSONIt works fine with everything except I haven't found a way to load special chars, so if i have { "json_text":"Hello, goodbye! I work fine!" } but If i need a special char like àùòèéì it won't work, I've tryied with { "json_text":"òàùèéì I r...

HTML entities do not render correctly in browser after XSLT transform

I have the following XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <example> <contactInfo> <id>12319221</id> <name>Jerry P</name> <market> <name>Test</name> <phone>800.555.1010</phone> </market> <agent> <name>Test User</name> <emai...

how to convert a character to 7 bit even parity in php

I want to convert a Character to a 7 bit even parity. Can you please suggest me, how to implement this? ...

Creating files with french characters and encoding.

HI, I am creating a file like so. FileStream temp = File.Create( this.FileName ); Then putting data in the file like so. this.Writer = new StreamWriter( this.Stream ); this.Writer.WriteLine( strMessage ); That code is encapsulated in a class hierarchy but that is the meat and potatoes of it. My problem is this. MSDN says that the ...

Problems displaying some characters

I've got an XML file from which I've extracted the following text - The Sansa Clip+ MP3 player gives you more to enjoy. Enjoy up to 2,000 songs†† with an 8GB* player, FM radio, long-life battery and voice recorder. PLUS now even more! Expand your enjoyment when you add in preloaded content cards** into the new memory ...

clean up strange encoding in ruby

I'm currently playing a bit with couchdb. I'm trying to migrate some blog data from redis (key value store) to couchdb (key value store). Seeing as I probably migrated this data a gazillion times from and to different blogging engines (everybody has got to have a hobby :) ), there seem to be some encoding snafus. I'm using CouchREST to a...

Special characters in OSX filename ? (Python os.rename)

I am trying to rename some files automatically on OSX with a python script. But I fail to work with special characters like forward slash etc.: oldname = "/test" newname = "/test(1\/10)" os.rename(oldname, newname) I think I do have an encoding problem. But different tries with re.escape or using UTF-8 unicode encodings havent been su...

retaining characterset over dblink

Hi friends, I have created a db link between 2 database with different character set.One is AL32UTF8 and other is US7ASCII.I want to know how can i retain the character set when using dblink.I have chinese character in AL32UTF8 which i want to view in US7ASCII using a dblink. ...