I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thought I could use the ASCII function, but SELECT ASCII('é') FROM DUAL in Oracle gives me 50089.
I coded this as a quick fix, but I'm sure there's a better way.
FUNCTION escape_latin(p_str IN VARCHAR2) RETURN VARCHAR2 IS
v_str VARCHAR2(3000) := p_str;
BEGIN
v_str := REPLACE(v_str, 'À', 'À');
v_str := REPLACE(v_str, 'Ã', 'Á');
v_str := REPLACE(v_str, 'Â', 'Â');
v_str := REPLACE(v_str, 'Ã', 'Ã');
v_str := REPLACE(v_str, 'Ä', 'Ä');
v_str := REPLACE(v_str, 'Ã…', 'Å');
v_str := REPLACE(v_str, 'Æ', 'Æ');
v_str := REPLACE(v_str, 'Ç', 'Ç');
v_str := REPLACE(v_str, 'È', 'È');
v_str := REPLACE(v_str, 'É', 'É');
v_str := REPLACE(v_str, 'Ê', 'Ê');
v_str := REPLACE(v_str, 'Ë', 'Ë');
v_str := REPLACE(v_str, 'ÃŒ', 'Ì');
v_str := REPLACE(v_str, 'Ã', 'Í');
v_str := REPLACE(v_str, 'ÃŽ', 'Î');
v_str := REPLACE(v_str, 'Ã', 'Ï');
v_str := REPLACE(v_str, 'Ã', 'Ð');
v_str := REPLACE(v_str, 'Ñ', 'Ñ');
v_str := REPLACE(v_str, 'Ã’', 'Ò');
v_str := REPLACE(v_str, 'Ó', 'Ó');
v_str := REPLACE(v_str, 'Ô', 'Ô');
v_str := REPLACE(v_str, 'Õ', 'Õ');
v_str := REPLACE(v_str, 'Ö', 'Ö');
v_str := REPLACE(v_str, '×', '×');
v_str := REPLACE(v_str, 'Ø', 'Ø');
v_str := REPLACE(v_str, 'Ù', 'Ù');
v_str := REPLACE(v_str, 'Ú', 'Ú');
v_str := REPLACE(v_str, 'Û', 'Û');
v_str := REPLACE(v_str, 'Ü', 'Ü');
v_str := REPLACE(v_str, 'Ã', 'Ý');
v_str := REPLACE(v_str, 'Þ', 'Þ');
v_str := REPLACE(v_str, 'ß', 'ß');
v_str := REPLACE(v_str, 'Ã ', 'à');
v_str := REPLACE(v_str, 'á', 'á');
v_str := REPLACE(v_str, 'â', 'â');
v_str := REPLACE(v_str, 'ã', 'ã');
v_str := REPLACE(v_str, 'ä', 'ä');
v_str := REPLACE(v_str, 'Ã¥', 'å');
v_str := REPLACE(v_str, 'æ', 'æ');
v_str := REPLACE(v_str, 'ç', 'ç');
v_str := REPLACE(v_str, 'è', 'è');
v_str := REPLACE(v_str, 'é', 'é');
v_str := REPLACE(v_str, 'ê', 'ê');
v_str := REPLACE(v_str, 'ë', 'ë');
v_str := REPLACE(v_str, 'ì', 'ì');
v_str := REPLACE(v_str, 'Ã', 'í');
v_str := REPLACE(v_str, 'î', 'î');
v_str := REPLACE(v_str, 'ï', 'ï');
v_str := REPLACE(v_str, 'ð', 'ð');
v_str := REPLACE(v_str, 'ñ', 'ñ');
v_str := REPLACE(v_str, 'ò', 'ò');
v_str := REPLACE(v_str, 'ó', 'ó');
v_str := REPLACE(v_str, 'ô', 'ô');
v_str := REPLACE(v_str, 'õ', 'õ');
v_str := REPLACE(v_str, 'ö', 'ö');
v_str := REPLACE(v_str, '÷', '÷');
v_str := REPLACE(v_str, 'ø', 'ø');
v_str := REPLACE(v_str, 'ù', 'ù');
v_str := REPLACE(v_str, 'ú', 'ú');
v_str := REPLACE(v_str, 'û', 'û');
v_str := REPLACE(v_str, 'ü', 'ü');
v_str := REPLACE(v_str, 'ý', 'ý');
v_str := REPLACE(v_str, 'þ', 'þ');
v_str := REPLACE(v_str, 'ÿ', 'ÿ');
RETURN v_str;
END escape_latin;
Is there a built in function I can use to make this cleaner and shorter?
Thanks
"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP that does this? I see them on Wordpress and Joomla and such but I've been trying to learn exactly how
Sub-domains & calling unique content
Hello,Is there a way use something similar to the $_GET function for a sub-domain? I to be able to have my sub-domains all use the root directory, but have information filtered for a specific
Include a php
Hello, I'm trying to include a function that shows the recent searches. Example I have index.html-------------------------------------------------------------------------
Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a designer than coder and I can't figure this out. It is on the following
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values in the array; I keep getting an undefined index. Something is not right, but the code is so simple!
MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an error... and was hoping someone could help me out.You have an error in your SQL syntax; check the manual
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back
Email Form Syntax Issue
I need the TO: in email to display To: CEO instead of To: abc@mail.comHow to alter the script below?Code: <?PHP$to = "abc@mail.com";$subject = "subject"; $headers =
Error when call dll from oracle
Hi all, please help me!
How to generate a text file using php...?
Hi, Can anyone give me code to generate a text file using phpThanks in advance