473,799 Members | 3,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web site to translate spanish characters into corresponding htmlcodes?

Hi,

I have certain blocks of Spanish text, for example

¿Necesita agregar una impresora o copiadora adicional a su forma
personalizada de orden? Presione aquí.

Don't know if the backwards question mark and the accented "i" came
through, but I was wondering if anyone knew of a site where I could
cut and paste the above and it would spit back the corresponding html
codes (e.g. {) for the appropriate Spanisn symbols.

Thanks for any advice, - Dave
Jun 27 '08 #1
10 2663
..oO(laredotorn ado)
>I have certain blocks of Spanish text, for example

¿Necesita agregar una impresora o copiadora adicional a su forma
personalizad a de orden? Presione aquí.

Don't know if the backwards question mark and the accented "i" came
through, but I was wondering if anyone knew of a site where I could
cut and paste the above and it would spit back the corresponding html
codes (e.g. {) for the appropriate Spanisn symbols.
With UTF-8 you could write all those chars literarily without any
character references.

Micha
Jun 27 '08 #2
In comp.infosystem s.www.authoring.html message <a2cb0dce-8809-4123-bfd6-
43**********@s1 3g2000prd.googl egroups.com>, Mon, 14 Apr 2008 19:16:05,
laredotornado <la***********@ zipmail.compost ed:
>I have certain blocks of Spanish text, for example

¿Necesita agregar una impresora o copiadora adicional a su forma
personalizad a de orden? Presione aquí.

Don't know if the backwards question mark and the accented "i" came
through, but I was wondering if anyone knew of a site where I could
cut and paste the above and it would spit back the corresponding html
codes (e.g. {) for the appropriate Spanisn symbols.
I see the inverted question mark, but no accents.

One could easily be written, e.g. by yourself. A TEXTAREA for input, a
BUTTON, a TEXTAREA for output, and a series of RegExps, acting on the
content of the first area and writing to the second.

DEMO : ake a copy of my <URL:http://www.merlyn.demon.co.uk/js-
quick.htm>; put ¿Que? in F.X0, F.X1.value = F.X0.value.repl ace(/¿/g,
"{") in the textarea, press Eval, and read F.X1. Then copy F.X1
to the textarea, press HTML, and observe that it's not { that you
need (it's ¿).

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE7 FF2 Op9 Sf3
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jun 27 '08 #3
laredotornado wrote:
Hi,

I have certain blocks of Spanish text, for example

¿Necesita agregar una impresora o copiadora adicional a su forma
personalizada de orden? Presione aquí.

Don't know if the backwards question mark and the accented "i" came
through, but I was wondering if anyone knew of a site where I could
cut and paste the above and it would spit back the corresponding html
codes (e.g. {) for the appropriate Spanisn symbols.

Thanks for any advice, - Dave
Few years ago I wrote TEDU (freeware). Try it.
http://www.practisoft.cz/?download+en

--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>

Jun 27 '08 #4
Dr J R Stockton wrote:
One could easily be written, e.g. by yourself. A TEXTAREA for input,
a BUTTON, a TEXTAREA for output, and a series of RegExps, acting on
the content of the first area and writing to the second.
If you are going to go that route, write it in Perl and take advantage
of the HTML::Entities module. No need to write all those regexen.
Jun 27 '08 #5
On Tue, 15 Apr 2008, Dr J R Stockton wrote:
>Presione aquí.

I see the inverted question mark, but no accents.
El acento está aquí.
^

--
http://niwo.mnsys.org/saved/~flavell/charset/
Jun 27 '08 #6
On Apr 16, 3:03*am, Scott Bryce <sbr...@scottbr yce.comwrote:
Dr J R Stockton wrote:
One could easily be written, e.g. by yourself. *A TEXTAREA for input,
a BUTTON, a TEXTAREA for output, and a series of RegExps, acting on
the content of the first area and writing to the second.

If you are going to go that route, write it in Perl and take advantage
of the HTML::Entities module. No need to write all those regexen.
Then do it yourself <g.

IMHO, it's much easier to do it in JavaScript, the natural language
for the OP's request of a "site", than it would be to learn Perl. And
it turns out that there's no need to write RegExps as such, if one
provides an input area for the user to define the conversions.

The following includes self-test :

<form class=TRY action="#">
<textarea name=T0 cols=69 rows=4>
Replace first field by second field
¿ &amp;#191; Comment follows second TAB
q Q Paste new content into this box
</textarea>
<textarea name=T1 cols=69 rows=4>
Text input
¿que?</textarea>
<br><input type=button value="->" onClick="TextCo nv(this.form)"> <br>
<textarea name=T2 cols=69 rows=4></textarea>
</form>
function TextConv(F) { var St, XX, J
XX = F.T0.value.spli t(/[\r\n]+/)
St = F.T1.value
for (J=0 ; J<XX.length ; J++) {
XX[J] = XX[J].split("\t")
if (XX[J].length==1) XX[J][1] = ""
XX[J][0] = new RegExp(XX[J][0], "g") }
for (J=0 ; J<XX.length ; J++) St = St.replace(XX[J][0], XX[J][1])
F.T2.value = St }
I did it in my js-misc1.htm#TS; but I'll not be leaving it there if
signs of excessive use appear - take a COPY. RSVP if bugs are found;
tested in IE7 FF2 Op9 Sf3. FF2 has a mini-bug : the testareas appear
to be 5 rows.
BTW, my newsreader did in fact show the accented í, about one pixel
different from a normal one at normal size, but good at 20 pt.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@ph ysics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demo n.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ...
Jun 27 '08 #7
Dr J R Stockton wrote:
IMHO, it's much easier to do it in JavaScript, the natural language
for the OP's request of a "site", than it would be to learn Perl.
That depends on whether the OP knows JavaScript better than Perl. I know
Perl better than JavaScript.
And it turns out that there's no need to write RegExps as such, if
one provides an input area for the user to define the conversions.
Yuck!

So in your solution, the user has to look up the entities himself, and
enter them into a text area, and hope he doesn't make any mistakes.

-------

use strict;
use warnings;
use HTML::Entities;

while(<DATA>)
{
print encode_entities ($_);
}

__DATA__
¿Necesita agregar una impresora o copiadora adicional a su forma
personalizada de orden? Presione aquí.
vis-à-vis Beyoncé's naïve papier-mâché résumé
Jun 27 '08 #8
In comp.infosystem s.www.authoring.html message <Zq-dncQBL_P-RZvVnZ2dnUVZ
_g******@comcas t.com>, Wed, 16 Apr 2008 22:56:01, Scott Bryce
<sb****@scottbr yce.composted:
>Dr J R Stockton wrote:
>IMHO, it's much easier to do it in JavaScript, the natural language
for the OP's request of a "site", than it would be to learn Perl.

That depends on whether the OP knows JavaScript better than Perl. I know
Perl better than JavaScript.
Therefore we have different limitations, but they are, as far as has
been written here, equal in number.
>And it turns out that there's no need to write RegExps as such, if
one provides an input area for the user to define the conversions.

Yuck!

So in your solution, the user has to look up the entities himself, and
enter them into a text area, and hope he doesn't make any mistakes.
That is true. But he can use the solution as is, without seeking Perl;
and the content of the area can be copied and pasted for re-use. I've
added a simple test which will verify the entities. Additionally, your
solution does only what was asked for, whereas mine allows more general
substitutions, for which Perl would need more code.

--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demo n.co.uk/clpb-faq.txt RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zipTimo Salmi's Turbo Pascal FAQ.
Jun 27 '08 #9
Dr J R Stockton wrote:
That is true. But he can use the solution as is, without seeking
Perl;
So build the Perl solution into a cgi application. Then only the server
needs Perl. I kept the code simple to demonstrate how simple it is to
encode enities in Perl.
and the content of the area can be copied and pasted for re-use.
So can any output from a Perl script.
I've added a simple test which will verify the entities.
Not necessary with the Perl solution.
Additionally, your solution does only what was asked for,
But it does do what was asked for. Isn't that what it is supposed to do?
Yours only does what was asked for if the user manages to do most of the
work himself by hand.
whereas mine allows more general substitutions, for which Perl would
need more code.
Well, yes, but that isn't what the spec called for.
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2341
by: Bengt Richter | last post by:
Just thought None as the first argument would be both handy and mnemonic, signifying no translation, but allowing easy expression of deleting characters, e.g., s = s.translate(None, 'badcharshere') Regards, Bengt Richter
2
1868
by: poisondart | last post by:
Is there a predefined entity set for Spanish accents? I know that I could just easily make one, except that I intend to do this for other languages in the future, which may have more accents than Spanish. The closest to what I was expecting was this link: http://www.altheim.com/specs/charents.html ....but the link to the ent file is broken. What is the usual/preferred method that you employ to render special
9
7843
by: JezB | last post by:
Is there anything in the framework which will help translate accented characters in strings to their standard counterparts? eg. "Gráda" to "Grada"
3
5128
by: Chip | last post by:
There is surprisingly little information on the various encoding options for reading a text file. I have what seems to be a very basic issue: I'm reading a text file that includes Spanish characters such as "ñ". When I read the file into a string, that character is missing. Encoding seems to be the culprit. File writers SHOULD begin a file with the BOM (Byte Order Mark) to let us know what encoding to read the file with, but most software...
2
7306
by: pramod | last post by:
Hi I am facing the problem while inserting the spanish characters in the DB2 UDB v8.2 database. We are pulling the data from SQL server through informatica and then pushing the same in the DB2 database. Codepage for DB2 database is UTF-8, which is Unicode. Whenever it is encountering any spanish charater it is giving the following error: SQL0302N The value of a host variable in the execute or open statement is too large for its...
4
3458
by: norikus | last post by:
C will read a text file and store the Spanish characters (á, é, í, ó, ú, ñ, and ¿) as simple ASCII characters. No problem. C#, though, acts as if it's blind. The text string "bahía" read from a file comes out as "baha" and if I'm testing for spelling errors (I'm a Spanish teacher) it's no help. From what I can find on the Internet, the .NET system appears to render accented characters into more complex structures, but I can't find any examples...
5
5471
by: tushar.saxena | last post by:
This post is a follow up to the post at : http://groups.google.com/group/comp.lang.c++/browse_thread/thread/83af6123fa945e8b?hl=ug#9eaa6fab5622424e as my original question was answered there, but I have some additional problems now. Basically what I want to do is : Given an input UTF-8 encoded file containing HTML sequences such as "&amp;", I want to be able to replace these sequences with their UTF-8 representations (i.e. "&") What I...
4
2609
by: =?Utf-8?B?TGVvbg==?= | last post by:
Hi everybody. I am using streamreader to show spanish .htm page on my website. Unfortunately those spanish characters that have stresses on top (like: Ó,á, ....) do not show correctly. Is there any way to overcome this problem?
3
4712
by: Kenneth McDonald | last post by:
I have the need to occasionally translate a single word programatically. Would anyone have a Python script that would let me do this using Google (or another) translation service? Thanks, Ken
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.