Thread: How to write other than english language in text/xml file by reading english text/xml

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    26

    How to write other than english language in text/xml file by reading english text/xml

    Hello Team,
    I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file.
    Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write code.Not only japanese but also there 11 more languages[French/CHinesh,swedish,turkey,italy,....]. Hoping that if i complete one language remaining may be easy to complete.
    I really looking forward your help at the earliest moment.Thank you.

    Regards,
    Senthil Andavar






  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So do you intend to use a library to do all the heavy lifting?
    Welcome to Expat! * Expat XML parser
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    Do you know the format of the Japanese text file? Is it UTF-8? Is it something else?

    If you don't know what the format is, then paste the output of this program (replace "filename" with the file name) :
    Code:
    #include <iostream>
    #include <iomanip>
    #include <fstream>
    using namespace std;
    
    int main() {
        ifstream fin("filename", ifstream::binary);
        if (!fin) {
            cerr << "Can't open file\n";
            return 1;
        }
        cout << hex << setfill('0');
        for (int i = 0; i < 100; i++) {
            char ch = fin.get();
            cout << setw(2) << int((unsigned char)ch) << ' ';
        }
        cout << '\n';
    }
    A little inaccuracy saves tons of explanation. - H.H. Munro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 04-18-2013, 03:37 PM
  2. Replies: 15
    Last Post: 04-17-2013, 09:00 AM
  3. Replies: 6
    Last Post: 08-20-2012, 07:09 AM
  4. Extract text(English & Chinese) from pdf
    By wonderway in forum C Programming
    Replies: 1
    Last Post: 03-31-2011, 11:39 PM
  5. Replies: 28
    Last Post: 10-30-2008, 03:52 PM

Tags for this Thread