How to determine the std::locale by HTML charset 
Author Message
 How to determine the std::locale by HTML charset

    I am writing a tiny program to treat HTML files, I use wstring to store
it in memory. My thinking is: read some original byte, get the charset info,
chosen the codepage and locale, then re-read it using std::wifstream. For
UTF-16 stored files, read it immediately.
    Are there any relation between charsets and codepages even locales? Or I
am wandering in the wrong way? How to implement uniform manipulation of text
by not concerning about the physical-store method?
    Perhaps I hav't explain it clear enough, but I have try my best.
    Thanks to all who reads this message.


Fri, 08 Apr 2005 21:31:07 GMT  
 How to determine the std::locale by HTML charset

Quote:

>     I am writing a tiny program to treat HTML files, I use wstring to store
> it in memory. My thinking is: read some original byte, get the charset info,
> chosen the codepage and locale, then re-read it using std::wifstream. For
> UTF-16 stored files, read it immediately.
>     Are there any relation between charsets and codepages even locales? Or I
> am wandering in the wrong way? How to implement uniform manipulation of text
> by not concerning about the physical-store method?
>     Perhaps I hav't explain it clear enough, but I have try my best.

It's kinda complicated. You might begin by reading the Dinkum CoreX Library
Reference at our web site.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



Fri, 08 Apr 2005 21:53:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Windows locale LCID and std::locale

2. std::exception: missing locale facet

3. Determining the Index position from a std::find

4. determining HTML name at design time

5. No std::min or std::max?

6. bug: VS7.0 (6.0) C++ std::auto_ptr conflict with std::vector

7. convert between std::string and std::wstring

8. convert non std::string to std::string

9. Warnings for std::vector<std::string>

10. export classes using std namespace (ex std::vector) in a DLL

11. typedef std::vector<std::string> Vector_String

12. VC6, STL, std::set_new_handler and std::bad_alloc

 

 
Powered by phpBB® Forum Software