The encoding
i make web site writen with arabic but it dosnt appear with arabic
in the site or data base how can i fix this problem
knowing that i use tomcat and i have no servlet use in the site
try using this tag inside the <head> tag
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
change the charset to UTF-8 or other charset which supports arabic
Similar Messages
-
How to change the Encoding type of a XML
Hi all,
I'm having a XML(generated at run time) with UTF-8 Encoding. If I'm going to parse it, getting an error saying "*Document root element is missing*".
If I change the encoding to ANSI, it parses without error.
How can I change the encoding type of a documnet ?
Any comment welcome.
KaushalyaThere's no such thing as the "encoding of a String". If you produced a String from a sequence of bytes using the wrong encoding, you may not be able to repair that problem by hacking about in your code. You're better off to produce the String using the correct encoding in the first place. Read this for more information about XML and encodings as you appear to be misunderstanding basic concepts:
[http://skew.org/xml/tutorial/] -
How to find out the encoding of a file
How to findout the encoding of a file being read?
Thanks in advance?It depends on the file.
Sometimes it is possible by analysing the file contents. Other times you have to know a priori.
And you are welcome. -
How to find out the encoding of an XML input document
Hello all,
I read a XML file into a DOM document and would like to save it back in the same encoding as the input. How do I find out the encoding of the input document?
This is my code for reading the document:
import java.io.File;
import java.io.FileInputStream;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
Transformer transformer = TransformerFactory.newInstance().newTransformer();
DOMResult domResult = new DOMResult();
transformer.transform(new StreamSource(new FileInputStream(fileName)),
domResult);
Document doc = (Document)domResult.getNode();
.FileInputStream fis = new FileInputStream(fileName);
String encoding = new InputSource(fis).getEncoding();
fis.close();Note that this only works because you can get an InputStream over the document twice. If the document were coming from an HTTP response (for example) it wouldn't work. -
Read a text file before knowing the encoding
Hi,
I've wrote a AppleScript to adjust time delay of *.lrc file(txt file but different extension).I only got a messed up text, in other aspect, it works well. I understand applescript read the text file using the wrong encoding, but I can't just set the encoding to UTF-8, for it can be UTF-8 and it can be Shift-JIS, Big5 andGB18030 as well. I don't know how to open text without getting messed up and write the result to a new text file on desktop using UTF-8 encoding. Can anyone help me with this? Thanks in advance.
Code:
on run
set _lrcFile to (choose file)'s POSIX path
display dialog "Time to delay (sec):" with title "Adjust LRC Delay" default answer "-0.5"
set _timeDelay to text returned of result
try
set _timeDelay to _timeDelay as real
on error
display dialog "Input must be a real" with title "Error" buttons {"Stop"} default button "Stop"
error number -128
end try
set _paraList to paragraphs of (read POSIX file _lrcFile)-->I don't know how to read text file properly here.
set _newLrc to ""
repeat with _para in _paraList
set _timecode to do shell script "sed 's/\\[\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}.[0-9]\\{2\\}\\)\\]\\(.*\\)/\\1 \\2/'<<<" & quoted form of _para
if _timecode as string is not (contents of _para) then
set _timecode to words of _timecode
set _min to (item 1 of _timecode) as integer
set _sec to (item 2 of _timecode) as real
set _sec to _sec + _timeDelay
set _min to _min + _sec div 60
set _sec to _sec mod 60
set _sec to (round (_sec * 100)) / 100
if _min < 10 then
set _min to "0" & _min as string
else
set _min to _min as string
end if
if _sec < 0 then
set _sec to "00.00"
else if _sec < 10 then
set _sec to "0" & _sec as string
else
set _sec to _sec as string
end if
if (count of _sec) < 5 then
set _sec to _sec & "0"
end if
set _lyrics to do shell script "sed 's/\\[\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}.[0-9]\\{2\\}\\)\\]\\(.*\\)/\\3/'<<<" & quoted form of _para
set _newLrc to _newLrc & "[" & _min & ":" & _sec & "]" & _lyrics & return
else
set _newLrc to _newLrc & contents of _para & return
end if
end repeat
-->write _newLrc to destop here (using UTF-8 encoding)
end run
Sample of *.lrc and the result after delaying 0.5s.Hope this post will help people doing their homeworks...
StringBuffer tmpBuffer = new StringBuffer();
try {
URL url = new URL("http://.../test.txt");
URLConnection urlconnection = url.openConnection();
long l = urlconnection.getContentLength();
tmpBuffer.append("Content Length = " + l);
BufferedReader in =
new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = in.readLine()) != null) {
tmpBuffer.append("\n" + line);
in.close();
} catch (Exception e) {
//System.out.println(e.toString());
if (tmpBuffer != null) {
wdContext.currentContextElement().setZoneMessage(
tmpBuffer.toString()); -
Finding and deleting the encoded file IDVD
hi,
i tried a onestep dvd and encoded from a camera. the dvd process stopped because hard drive memory ran low. i closed the project, and i can't find the file that just sucked up 6 GB worth of memory. it was never saved anywhere since it was one step what folders would it save to.I tried this (restart) and did NOT reclaim the space. My issue is that I was burning a ONE-STEP dvd from a file, and something happened mid-burn. So the burn failed, I started with 13 GB of space (ok, that's not the 20 you recommended, but I thought even 10 would be okay for this burn). Anyway, next thing I know I only have 1 GB left-- however, I don't know where to find the encoded assets, since there is NO dvd project folder associated with the one-step process. The imovie file is located on a separate hard drive, and a search of my computer doesn't reveal anything I can identify as space sucking dvd files. where are those encoded assets?
PLEASE HELP! -
How to export a PDF to a word document? at the moment it came up with "The encoding (CMap) specified by a font is missing ????? what can I do? thanks
Hi frenchiem,
This is due to the PDF file cannot display the original fonts. To fix it, creator should create the PDF file with the embed font option enabled. Thus, user can open the file on any platform with the same layout. Or the Acrobat product can display them after you install the appropriate font support package on the client side.
Regards,
Rave -
Illustrator 10 - "the encoding (CMap) specified by a font is missing"
Ni hao,
I'm trying to design a brochure in Illustrator 10 using Chinese characters. I'm running Leopard 10.5.8 on a PowerPC G4.
I have my Chinese text in a Word document in the 'Hei' font. I am able to successfully copy and paste the Chinese text into my Illustrator file, but when I try to save my Illustrator file, it fails and I get this error message:
"the encoding (CMap) specified by a font is missing"
Thanks for the help!
-JoshHI Josh,
Try starting up in Safe Mode. http://support.apple.com/kb/HT1455
It disables all fonts other than those in /System/Library/Fonts (Mac OS X 10.4 or later) and forces a directory check of the startup volume. Might help...
Carolyn -
How can I change the encoding of a font "on the fly" in Illustrator
Is it possible to do that. I saw that in CorelDraw if you press Ctrl+Shift+E with a text selected a dialog windows appears with the option to choose beteen different code tables, so non unicode fonts can be made to show the right gliphs. Or maybe there is a script somewhere I dont know of. Thank you in advance!
Monika Gause wrote:
Set the encoding when placing the text in Illustrator
How can I do that? I know that I can do my work in Corel then copy-paste it in Illustrator, but I wanted to know if there is a way to do it in Illustrator, besides I dont want to go back and forth between them, if I later dacide to make some corrections. Thank you! -
How to set the encoding of an XML-document
I need to change the encoding of an xml-document.
When I convert the document into a string, UTF-8
is used, I want to use ISO-8859-1.use this in your identity transform:
transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1"); -
How to get the "encoding" of a XML file using JDOM
As in XML file, <?xml version="1.0" encoding="UTF-8" ?> indicates the encoding of this file
while using JDOM to parse a XML file, how can I get the encoding type?
thanx!!!What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
Thanx all for your help and attention!!! -
How to get the encoding of a XML file ...
Hi,
How do you get the encoding of a XML file?
For example,
<?xml version="1.0" encoding="SJIS"?>
I am trying to retrieve the above encoding="SJIS", but I can't seem to locate the API for doing so.
Thanks in advance for any help,
EricHi ddossot,
Thanks for your suggestion.
However, the xerces.jar file that comes with my old tomcat server is an old version and thus, the getEncoding method is not even present in the DocumentImpl class. The option to update to a newer version of tomcat and xerces is not available. What a pity... :-(
Well, I just have to try to find a way around. Worst case scenario, parse the first line in the xml file myself.
Regards,
Eric -
How to find the encoding of a file?
hi,
Is it possible to findout the encoding of a file through programing?
thanks,
Mahithanks tcristino for update,
but this link contains the info about BOM. Is it possible to know the BOM data from programming?
thanks,
Mahender -
How to change the encoding value in jdom?
When I create a new xml file by using jdom, the encoding value of xml is "UTF-8"
(<?xml version="1.0" encoding="UTF-8"?>).
How can I change encoding value to "big5"??
ThanksUse this method (JDom API)
XMLOutputter.setEncoding(java.lang.String encoding)
Regards,
Darren -
Numbers to CSV export script: how to specify the encoding?
Hi,
I'm using the following script to export a Numbers document to CSV:
# Command-line tool to convert an iWork '09 Numbers
# document to CSV.
# Parameters:
# - input: Numbers input file
# - output: CSV output file
# Attik System, Philippe Lang
# Creation date: 31 mai 2012
# Modification date:
on run argv
# We retreive the path of the script
set myPath to (path to me)
tell application "Finder" to set myFolder to folder of myPath
# We get the command line parameters
set input_file to item 1 of argv
set output_file to item 2 of argv
# We retreive the extension of the file
set theInfo to (info for (input_file))
set extname to name extension of (theInfo)
# Paths
set input_file_path to (myFolder as text) & input_file
set output_file_path to (myFolder as text) & output_file
if extname is equal to "numbers" then
tell application "Numbers"
open input_file_path
save document 1 as "LSDocumentTypeCSV" in output_file_path
close every window saving no
end tell
end if
end run
It works fine, except that I don't know how to specify the encoding of the text in the CSV file (Latin1, MacRoman, Unicode). This option is available in the export dialog of Numbers. Any hint on how to do that is welcome. (GUI Scripting?)
Where can I find documentation on the iWork "vocabulary" available? Is there a definitive documentation somewhere? I tried to record an manual export in the script editor, without success. Script is more or less empty.
Thanks!
Philippe LangA further note from Yvan. He's made some revisions to the script sent earlier.
--{code}
--[SCRIPT export to CSV with selected encoding]
I added some features.
(1) Defining the encoding thru the preferences file apply only if
the application is not in use because the file is read only once in a session.
A test urge you to quit Numbers if it is running.
(2) info for is deprecated so it may be removed by Apple tomorrow.
I no longer use it.
(3) just for the fun, I added a piece of code allowing you to select the encoding on the fly.
Thanks to the property chooseEncodingInScript, at this time the script use Unicode (UTF-8)
(4) I'm wondering which tool is used to launch this script,
I don't know the way to pass arguments when I run one.
Yvan KOENIG (VALLAURIS, France)
2012/06/13
property chooseEncodingInScript : false
true = the script will ask you to select the encoding
false = the script use the embedded encoding
on run argv
set input_file to (item 1 of argv) as text
set output_file to (item 2 of argv) as text
set myPath to (path to me) as text
tell application "System Events"
set theProcesses to name of every application process
set myFolder to path of container of (disk item myPath)
set input_file_path to myFolder & input_file
set output_file_path to myFolder & output_file
set extname to name extension of (disk item input_file)
end tell
if extname is "numbers" then
if "Numbers" is in theProcesses then error "Please, quit “Numbers” before running this script !"
if chooseEncodingInScript then
set theList to {"Mac OS Roman", "Unicode (UTF-8)", "Windows Latin 1"}
set maybe to choose from list theList with prompt "Choose the default encoding applying to export as CSV"
if maybe is false then
error number -128
else if item 1 of maybe is item 1 of theList then
30 -- Mac OS Roman
else if item 1 of maybe is item 2 of theList then
4 -- Unicode (UTF-8)
else
12 -- Windows Latin 1
end if
else
4 -- Unicode (UTF-8)
end if
do shell script "defaults write com.apple.iWork.Numbers CSVExportEncoding -int " & result
tell application "Numbers"
open input_file_path
save document 1 as "LSDocumentTypeCSV" in output_file_path
close every window saving no
end tell
end if
end run
--{code}
Regards,
Barry -
Controlling the encoding of a PDF printed with a virtual printer?
Hi all.
In another thread, I was told that I cannot change the encoding of fonts with Adobe Reader. How about with Acrobat?
In an existing business process, users print PDFs to a virtual printer from Acrobat Reader. The resulting PDF somtimes contain CID fonts with encoding Identity-H.
Not all PDF viewers do this, some keep the encoding of the original pdf (same virtual printer used).
Can I control the encoding of the resulting PDF by printing from Acrobat (or any other Adobe product)?
All comments appreciated,
/MartinThanks for answering!
1) I realize it seems strange, but the virtual printer is embedded in one of our products. The product uses Windows printing as a point of integration in order to enable almost any windows program (including PDF readers) to send data to our server. In effect, we use pdf as our data protocol over the wire. It's a long story...
2) The virtual printer embedded in our product is NovaPDF.
3) I wish it wasn't an issue, but the library we use to extract text (PDFNet) does not seem to handle it very well. However, I am simultaneously looking for a solution in that end too.
The problem only occurs very rarely, for specific PDFs only. PDFs created by the library iText seem to be particularly problematic.
Maybe you are looking for
-
My idvd has stopped burning when it involves a 2-part movie or series. It starts alright but then stops and gives and error, not a code just says there was an error and the little box comes up that says I inserted a blank dvd and asks what I want to
-
Spry Collapsible Panel - Head Scratcher
Hello Spry Guru's, Perhaps an easy question for you, but it has me scratching my head: When first displayed, My Cary website's CollapsiblePanel up-arrow does not display correctly. After you open and close the panel it will display correctly. Also wh
-
Change picture package default background color
How do I change the background color for a picture package? It keeps defaulting to white. I need it to be black. Thanks, SP
-
I was just wondering if anyone might have some suggestions for how to make the hand and cards look more realistic. It's a layered document, with the picture of the croupier, the cards, and the hand all on separate layers. I want it to look a bit more
-
Error "Cannot navigate out of current form" is raised after closing window.
Hello, We are currently migrating from Designer 6.0 with Headstart 2.1.2 to Designer 6i release 4.10 with Headstart 6.5.3.0. We have a form with an action item in it to call another form. An error FRM-41351 "Cannot navigate out of current form" is ra