473,385 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unicode + SVG problem

Hi,

A simple task is driving me crazy, just can figure out how to
programatically write unicode characters to a SVG (XML) document.

With an editor it is easy to write Unicode characters like &#x431
(Cyrillic) to an SVG text element.

Trying to do the same with code is a pain but there must be some
solution.

I've tried to do it with vb.net using both InnerHtml, InnerText and
CDATA but the ampersand is always encoded as & just can figure out
how to add an unencoded ampersand. Tried to do the same through the
Adobe SVG plugins Javascript method setData() but the result was the
same. The only solution I've come up with is using XSLT
transformations or simply postprocess the XML/SVG contents as plain
text but this is definitely not something I would want to do.

There must be a solution to this simple task ?!

Regards
KL
Jul 20 '05 #1
1 2848


Klaubator wrote:

A simple task is driving me crazy, just can figure out how to
programatically write unicode characters to a SVG (XML) document.

With an editor it is easy to write Unicode characters like &#x431
(Cyrillic) to an SVG text element.

Trying to do the same with code is a pain but there must be some
solution.

I've tried to do it with vb.net using both InnerHtml, InnerText and
CDATA but the ampersand is always encoded as & just can figure out
how to add an unencoded ampersand. Tried to do the same through the
Adobe SVG plugins Javascript method setData() but the result was the
same. The only solution I've come up with is using XSLT
transformations or simply postprocess the XML/SVG contents as plain
text but this is definitely not something I would want to do.

There must be a solution to this simple task ?!


If you do DOM programming of XML documents then usually you don't need
to escape Unicode characters as the DOM operates directly on the Unicode
text data so you can simply use a string with the characters you want
and insert them into a text node with DOM methods. The only problem are
programming languages where strings are not Unicode encoded but VB.NET
or JavaScript shouldn't be a problem. For instance with JavaScript
textNode.setData(String.fromCharCode(0x431))
or directly
textNode.setData('б')
should do

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

8
by: sebastien.hugues | last post by:
Hi I would like to retrieve the application data directory path of the logged user on windows XP. To achieve this goal i use the environment variable APPDATA. The logged user has this name:...
8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
14
by: wolfgang haefelinger | last post by:
Hi, I wonder whether someone could explain me a bit what's going on here: import sys # I'm running Mandrake 1o and Windows XP. print sys.version ## 2.3.3 (#2, Feb 17 2004, 11:45:40)
19
by: Svennglenn | last post by:
I'm working on a program that is supposed to save different information to text files. Because the program is in swedish i have to use unicode text for ÅÄÖ letters. When I run the following...
6
by: peter pilsl | last post by:
postgres 7.3.2 I store unicode-data in postgresql. The data is retrieved via webinterfaces, processed with perl and then stored in postgresql (and viceversa). All is going nice with one...
1
by: Paul | last post by:
Hi, I am extending an existing MFC app to use Unicode (for a Japanese version of the interface elements). The app's purpose is to control a peripheral device through the serial port, and the...
3
by: Kidus Yared | last post by:
I am having a problem displaying Unicode characters on my Forms labels and buttons. After coding Button1.Text = unicode; where the unicode is a Unicode character or string (‘\u1234’ or...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
5
by: Holger Joukl | last post by:
Hi there, I consider the behaviour of unicode() inconvenient wrt to conversion of non-string arguments. While you can do: u'17.3' you cannot do:
5
by: Thierry | last post by:
Hello fellow pythonists, I'm a relatively new python developer, and I try to adjust my understanding about "how things works" to python, but I have hit a block, that I cannot understand. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.