Help - Search - Members - Calendar
Full Version: Chars to escaped unicode conversion with PsPad
BabelZilla Board > General > Help
Goofy
smile.gif

Let's suppose you problem is to have special chars from your language (diacritic chars and the kind) to be converted into Unicode in order to get a correct displaying.

Of course you can do that manually, but maybe you need some kind of automation.

What you need is

then you copy the unicodeentity file in the proper directory
C:\****\Program Files\PSPad\Convert (assuming your hd is c: )

Next, open your document with PsPad and follow the steps in the screenshots smile.gif

Click to view attachment

Click to view attachment

Click to view attachment

Click to view attachment
saster
For smaller jobs this link can be very useful, too:

http://people.w3.org/rishida/scripts/univi...%C3%BCrg%C3%A9t

Type your input into the Characters: box, then click Convert.
Attila
DaveG
Here's the little online converter I use for escaping for XML/XUL:
http://konieczny.be/unicode.html

The benefit of this one vs. ishida, which I've also used, is that it only escapes non-ascii and leaves the other characters it doesn't need to escape alone.
DaveG
I now present yet another product of Dave's boredom and curiosity:

Unicode to XML escaper in the form of a data URI
(bookmark the page, not the above link; need to use a tinyurl because this forum software hates data URIs)

The page exists soley in its own URL, so once bookmarked you'll have it forever. smile.gif

For those who are curious, here's the data: URI kitchen.
Goofy
QUOTE (DaveG @ Apr 18 2008, 11:54) *
I now present yet another product of Dave's boredom and curiosity:

Unicode to XML escaper in the form of a data URI
(bookmark the page, not the link; need to use a tinyurl because this forum software hates data URIs)

The page exists soley in its own URL, so once bookmarked you'll have it forever. smile.gif

For those who are curious, here's the data: URI kitchen.

unsure.gif uhhh some bit of explanation please.gif (remember we are no geeks here) when I click on your pygmy link I open a beautiful blank page, what should I do next?
DaveG
QUOTE (Goofy @ Apr 18 2008, 05:02) *
unsure.gif uhhh some bit of explanation please.gif (remember we are no geeks here) when I click on your pygmy link I open a beautiful blank page, what should I do next?

Odd. Works fine for me. You should see a trimmed down version of the konieczny converter with 2 text boxes, buttons, and labels. Paste text in the top, click convert, and it spits it out escaped.

Attached here is the actual file.
Goofy
smile.gif allright I can see the good job done (from your attached page), running smoothly. Thanks for that rockon.gif

as for the tinyurl, maybe anyone else than the submitter needs a registration or something? (still nothing visible for me)
DaveG
QUOTE (Goofy @ Apr 18 2008, 05:29) *
as for the tinyurl, maybe anyone else than the submitter needs a registration or something? (still nothing visible for me)

They have no registration of any kind; totally free. Found the problem, and my apologies. It seems that Firefox 3.0 can do that redirect just fine, but Firefox 2.0 can't. I've edited the link in my post to point to the preview page for the tinyurl to work around this. The data URI works fine in both versions; it's just the redirect via tinyurl that has issues. Sorry 'bout that. tongue.gif

And just in case, I should point out that IE doesn't support data URIs at all. IE8 might have some really basic support for really small ones, but that's it.
thm
Damn man that file is totally useless!!!!

Pspad already have an html safe converter for utf-8 basic special char.

This is what i call a totally useless thread. Found on google and made me only loose lot of time.

DAMN!!!!.

I need a file to convert from chinese, japanese and russian UTF-8 chars to relative html format like this : Š
I repeat that file was totally useless and already present in the PSPAD conversion folder.
thm
Sry for this reply to myself

But i solved the problem with a simple Javascript

Paste the following code into an new html file then open the file in your browser.

It will open a page with 2 textarea and a conversion button.
Then onjoy converting every utf-8 char into Я encoding.

Hope thi swill help more then above.

Ua can even use this to create PSD pad conversion files so u can embed conversion files for languages into your version of that editor.


QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>

<script type="text/javascript">


function toHtml()
{
var src = document.forms[0].from.value;
var dest = '';

for( var i=0; i<src.length; i++)
{
if(src.charCodeAt(i)>127)
dest+= '&#' + src.charCodeAt(i) + ';';
else
dest += src.charAt(i);
}
document.forms[0].to.value = dest;
}


</script>
</head>
<body>


<center>
<form name="converter" action="" onsubmit="return false">

Insert utf8 string<br />
<textarea style="width:80%;height:300px;" name="from" rows="15" cols="15"></textarea><br/>
<button onclick="toHtml()">CONVERT</button>
<hr />
<textarea style="width:80%;height:300px;" name="to" rows="15" cols="15"></textarea>
</form>
</center>
</body>
</html>
DaveG
thm: Calm down. I don't quite know what you're going on about here, but there's 3 separate JavaScript based converters in this thread. Please read the whole thread before complaining. If what you're saying is that the PsPad instructions in the first post are out of date, and that it has a converter file included with it now, then good for you. This thread is a year old, ya know.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.