When I use "UTF-16" in an OutputStreamWriter, the content will be wrong.
I want to write into a txt file, so I make code as fellow:
FileOutputStream fos = new FileOutputStream("c:\\test.txt", true);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-16");
BufferedWriter bw = new BufferedWriter(osw);
bw.write("TEST 0 1 2 3 4 5 6 7 8 9...");
However, the String in test.txt is
? T E S T 0 1 2 3 4 5 6 7 8 9 . . .
There is a "?" in front of the String...
If I use "CP950" then the content will be correct.
How could I solve the problem?
Thanks.
The encoding in the constructor of OutputStreamWriter must be the one used when the file is read. If you are to read the text file with your default encoding on your OS, then you do not need to invoke the constructor OutputSreamWriter(OutputStream stream, String encodingName) with the double arguments but the constructor OutputStreamWriter(OutputStream stream) with the single argument. Or you can know the default encoding by System.getProperty("file.encoding") which returns a String object which shows your default (text file) encoding.
Similar Messages
-
I use Lightroom to create a slideshow and then export it to software to burn to DVD to play on a TV. When i view it on a computer the pictures are fine, when i view them on the TV the aspect ration is wrong. Can anyone tell me what I'm doing wrong please? Thanks
The template is a document in itself, it is not applied to an existing document whether it is a Pages document or a Word document converted to a Pages document.
You would need to either copy and paste content, using existing styles, or apply the styles to the converted Word document.
You can Import the Styles from an existing document and those imported Styles can be used to override the current document's styles:
Menu > Format > Import Styles
The process is simplified if the styles use the same names, otherwise you will need to delete the style you don't want and replace it with the one that you do want when asked, then the substitution is pretty straightforward.
Peter -
How to keep the content of email (hotmail) in firefox when to forward or reply the mail. This is not the case when I use Internet Explorer.
See this:
https://support.mozilla.com/en-US/kb/Blank+messages+in+Hotmail -
came through
Hi, Brad.
Sorry for the issues that you're having. ExportPDF will export the content of the PDF - the text, images and layout. However, if you PDF was a fillable form, ExportPDF cannot export the form data.
Let me know if this didn't answer your question, or if you have additional questions or issues.
Dave -
When I use Home Sharing, I can see the library I want to copy under Shared, but I can't get it save on the computer under the regular library. I go to edit and "select all" but there is no import button that is in the right hand corner. Also, it will not let me click and drag the music. How do I get it from one computer to the other?
Since both computers are connected via the network, you could simply copy the ENTIRE iTunes folder from one computer to another via the network.
If both computers are running Windows, use the Easy File Transfer Utility built into Windows to move iTunes and all other user media/data. -
When I use my IPhone 4S to view the Shaw Go Movie Central App when I am at home I only use WiFi which is automatic, I start watching a show and sometimes I will get a message like "you can not use your cellular for video playback" or something close to that. Then I received an email from Telus saying I had used my 3G instead of Wi-Fi using 75% of my data. How can this happen when I'm on Wi-Fi at home? If it switched to 3G for some reason I should have been disconnected and not just transferred to 3G network using up my data. What is the fix for this??
It doesn't have to be that complicated, Verizon iPhones come unlocked, just tell VZ you're going on Holiday/Traveling and suspend the service, no need to pay for service if you're not going to be using it. Pick up local SIM cards in the countries of your choosing, pop them in, re-activate iMessage and you're set!
I recommend getting a SIM card from the Three network in England, they have great EU roaming rates and free like-home roaming in Italy.
Set your phone's region to match the country you're in, it'll save from some headaches when calling local/international numbers.
To answer your questions,
1. If you choose not to have a local SIM card, it is good to keep your phone in Airplane mode to save battery.
2. Make sure the two iPhones have different names to reduce sync/restore issues.
3. If husband has an iPhone also, you can chat with iMessage/Facetime, just give him heads up about the new number you'll have. Otherwise, use Whatsapp if he's got an Android. You can activate Whatsapp with your American number or the international number if you choose to get a SIM in Europe.
Also, Get the MagicJack app and/or Google Hangouts, both of those apps provide you with free calling to the USA and Canada using any internet connection. Google Voice is another good way to SMS across the seas.
Let me know if you need any more tips for iPhoning across the pond. -
Hello,
I have a Windows 7 Pc where Lightroom 5 is on installed.
When I open a photo using " verkenner" I see a good coloured photo.
When I open a photo via Lightroom 5, the photo will be too dark. This gives difficulties during shaping the photograph. Can someone help me to solve this problem?
Kind Regards,
MarianneInto the Develop module Not all the sliders in the Basic Panel are at 0.
Temperature ° is on 5600
Colourtint is on + 30
Balans: slider in the middle
History panel:
Balans gespitste tinten -3 0
Balans gespitste tinten -3 3 -
When to use SELECT and END SELECT in the query.
hi all,
When to use SELECT and END SELECT in the query.
regads,
Venkata Suresh Penke.Hi Suresh..
When do we need to use SELECT .. ENDSELECT
Usually we will never use SELECT .. ENDSELECT as it gives very poor performance.
But whenever we read a single Record we will use it as an alternative for SELECT SINGLE in some scenarios.
Eg: When the Full primary key is not specified in the WHERE clause.
SELECT * FROM MARC INTO WA_MARC UP TO 1 ROWS WHERE MATNR = P_MATNR.
ENDSELECT.
And other scenario is when we perform AGGREGATE OPERATIONS.when the Result is only one row.
SELECT SUM( LABST ) FROM MARD INTO V_LABST UP TO 1 ROWS
WHERE MATNR = P_MATNR.
ENDSELECT.
Note: In The Above scenario we cannot use SELECT SINGLE..
<b>REWARD IF HELPFUL.</b> -
Is there anyway to find a new font on Pages for iPad? The letters are hard like a rock when you use foreign languages like Thai. The fonts on device do not support foreign language.
varat_pond wrote:
Anyone in Apple if you see this message
These are user to user help forums. To tell Apple you want more fonts for Thai, go here:
http://www.apple.com/feedback/ipad.html
But I suspect this is likely one of those things for which you will always have to use a full computer rather than a iPad. -
I pick a photo, make a copy, add a mask and when I use a brush nothing happens to the mask or the picture. White or black.
If I understand you correctly, you have
Opened an image, and copied the background layer.
Added a layer mask, and finding that painting in the mask makes no difference whether you paint with black or white.
That is what you would expect to happen if both layers are identical. To demonstrate, make a change to the copied layer. Either change the blend mode to Multiply, or lower the opacity, or paint big red stripes across it. Now when you paint with black, the red stripes will disappear where the mask is black, and be visible where the make is white. -
m faceing one error on my screen when m using adobe premiere & save file then the one massage come on my display "adobe premier pro cs6 has been sttoped working" can you resolve the problem
Nobody can tell you anything without system information and other details. Ask in teh Premiere forum and provide al lthe required info.
Mylenium -
When i use a headphones they work and the speakers also work
when i use a headphones they work and the speakers also work
Hello did you try to update your sound drivers? You can also select as default device the headphones or the speakers in the sound configuration in control panel
-
i can see my contacts in my iPad using the contacts app, but i cannot see a single contact being synced to the iCloud contacts section when i use my computer to log into the iCloud website?
I am signed into the iCloud and contacts are turned on in the iCloud settings on my iPad. the iCloud account is checked in the groups area of the contacts settings. the calendar is turned on the same way and that syncs to iCloud...just not contacts.
-
HT3986 when i use windows 7 with macbook pro ,the fan work hardly,how do i fix it?
when i use windows 7 with macbook pro ,the fan work hardly,how do i fix it?
Use InputRemapper
This is one or only utility I know, there are I am sure one or two others.
And the weakest link in running Windows on Mac: lack of thermal/SMC fan control to manage air flow and heat! -
When I use my iPhone and go into the iTunes Store Search, it clocks/gets-stuck in Loading.
Also if I select iTunes and App Store in Settings, nothing happens.
Any advice?
Thanks.I guess no advice. Thanks anyway.
Maybe you are looking for
-
Hello How can I transfer my songs off my old Ipod classic to the computer so that I can pick them up with my new Ipod 4. Also I want to transfere some songs to my spouses Ipod 5. Please let me know what I can do... Thank you.. Alexandra
-
Keep getting error message when trying to eject iPOD nano
When trying to eject iPOD, getting error message ..."cannot be ejected because it contains files that are in use by another application". No other application is open but iTUNES. What does this mean? and are there any tricks to get it to eject?
-
Time Machine backup from previous install
Hey there, I am a small question for the use of Time Machine. I have a week of backups in Time Machine and I am pretty happy with how it works, but my questions is IF I format my computer with a clean install of Leopard, will my "old" backups in Time
-
Trouble importing accurate versions of Word docs into InDesign CC
HELP! Sometimes when I import a word document sent to me by a client, InDesign imports an older version of that word document. If I open the document they sent me in Word and compare it to the text that imports from the same document, it's sometimes
-
How to reinstall CS3 after uninstalling suite and getting error messages?
I have been using CS3 for a few years, and just a couple of weeks ago the InDesign program was having troubles, so I uninstalled the programs, and tried to reinstall from disc, but there are error messages and will not reinstall. I cleaned up all Ad