Jump to content


Important Announcement!

Please read this post about our new Privacy Policy


Photo
- - - - -

Chars to escaped unicode conversion with PsPad


  • Please log in to reply
10 replies to this topic

#1 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 16 April 2008 - 09:37 AM

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

  • PsPad text editor which is win only (sorry) but available in a number of languages for free
  • this conversion fileAttached File  UnicodeEntity.zip   703bytes   9 downloads (unzip please)
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

Attached File  before.png   12.04KB   31 downloads

Attached File  toolsmenu.png   18.11KB   27 downloads

Attached File  coverter_choice.png   20.99KB   25 downloads

Attached File  after.png   11.82KB   24 downloads
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#2 saster

saster

    [hu-HU] Moderator

  • BabelZillian Mods
  • 156 posts
  • Gender:Male
  • Location:Budapest, Hungary
  • Interests:Languages, 20ieth Century american short stories, French poems,<br />mammals and birds and other animals, humans, films (mainly Europeans), science, and ....


  • Translator for Hungarian (hu)
  • Extension Developer: Yes
  • Extensions: mid - mozilla internet dictionary

  • My OS Gnu/Linux

Posted 16 April 2008 - 10:07 AM

For smaller jobs this link can be very useful, too:

http://people.w3.org...s/univi...ürgét

Type your input into the Characters: box, then click Convert.
Attila

#3 DaveG

DaveG

    Techie Tricks and Tips provider

  • Super Mod
  • 447 posts
  • Gender:Male
  • Location:Philadelphia, PA, USA


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Flagfox, Config Descriptions, Crash Report Helper
  • My OS Gnu/Linux

Posted 16 April 2008 - 09:46 PM

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.

#4 DaveG

DaveG

    Techie Tricks and Tips provider

  • Super Mod
  • 447 posts
  • Gender:Male
  • Location:Philadelphia, PA, USA


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Flagfox, Config Descriptions, Crash Report Helper
  • My OS Gnu/Linux

Posted 18 April 2008 - 10:54 AM

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.

#5 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 18 April 2008 - 11:02 AM

QUOTE (DaveG @ Apr 18 2008, 11:54) <{POST_SNAPBACK}>
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?
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#6 DaveG

DaveG

    Techie Tricks and Tips provider

  • Super Mod
  • 447 posts
  • Gender:Male
  • Location:Philadelphia, PA, USA


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Flagfox, Config Descriptions, Crash Report Helper
  • My OS Gnu/Linux

Posted 18 April 2008 - 11:13 AM

QUOTE (Goofy @ Apr 18 2008, 05:02) <{POST_SNAPBACK}>
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.

Attached Files



#7 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 18 April 2008 - 11:29 AM

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)
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#8 DaveG

DaveG

    Techie Tricks and Tips provider

  • Super Mod
  • 447 posts
  • Gender:Male
  • Location:Philadelphia, PA, USA


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Flagfox, Config Descriptions, Crash Report Helper
  • My OS Gnu/Linux

Posted 18 April 2008 - 11:47 AM

QUOTE (Goofy @ Apr 18 2008, 05:29) <{POST_SNAPBACK}>
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.

#9 thm

thm

    Newbie

  • Members
  • 2 posts
  • Translator for [No translator]
  • Extension Developer: No

Posted 05 March 2009 - 10:14 AM

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 : &#x0160;
I repeat that file was totally useless and already present in the PSPAD conversion folder.

#10 thm

thm

    Newbie

  • Members
  • 2 posts
  • Translator for [No translator]
  • Extension Developer: No

Posted 05 March 2009 - 10:36 AM

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>


#11 DaveG

DaveG

    Techie Tricks and Tips provider

  • Super Mod
  • 447 posts
  • Gender:Male
  • Location:Philadelphia, PA, USA


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Flagfox, Config Descriptions, Crash Report Helper
  • My OS Gnu/Linux

Posted 05 March 2009 - 05:16 PM

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.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users