About Code Page (936) Warnings, and Unicode Encoding.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

About Code Page (936) Warnings, and Unicode Encoding.

niheaven
Hi,

I've noticed several people have post that in a non-Western code page environment, e.g. a Chinese based host, the compiling procedure will runing with 'warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss.'
The code page (936) is the Simplified Chinese code page, and the characters in these files are mostly currency symbols used in Europe, e.g. Euro, Franc. I met the same warnings, and I can avoid them by making my non-Unicode setting in Region to English (U.S.), but this is very inconvenient.
So, why cannot the QuantLib project save the source files in Unicode Encoding?

Sincerely,
Hsiao-nan Cheung
May 19, 2015
Reply | Threaded
Open this post in threaded view
|

Re: About Code Page (936) Warnings, and Unicode Encoding.

Luigi Ballabio
Is there a way to do it portably across compilers and operating systems?

Luigi

On Tue, May 19, 2015 at 4:31 AM, niheaven <[hidden email]> wrote:
Hi,

I've noticed several people have post that in a non-Western code page
environment, e.g. a Chinese based host, the compiling procedure will runing
with 'warning C4819: The file contains a character that cannot be
represented in the current code page (936). Save the file in Unicode format
to prevent data loss.'
The code page (936) is the Simplified Chinese code page, and the characters
in these files are mostly currency symbols used in Europe, e.g. Euro, Franc.
I met the same warnings, and I can avoid them by making my non-Unicode
setting in Region to English (U.S.), but this is very inconvenient.
So, why cannot the QuantLib project save the source files in Unicode
Encoding?

Sincerely,
Hsiao-nan Cheung
May 19, 2015



--
View this message in context: http://quantlib.10058.n7.nabble.com/About-Code-Page-936-Warnings-and-Unicode-Encoding-tp16574.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

回复: About Code Page (936) Warnings, and UnicodeEncoding.

niheaven
发自我的iPhone


------------------ 原始邮件 ------------------
发件人: Luigi Ballabio <[hidden email]>
发送时间: 2015年05月19日 15:42
收件人: niheaven <[hidden email]>
抄送: QuantLib users <[hidden email]>
主题: Re: [Quantlib-users] About Code Page (936) Warnings, and UnicodeEncoding.

Is there a way to do it portably across compilers and operating systems?

Luigi

On Tue, May 19, 2015 at 4:31 AM, niheaven <[hidden email]> wrote:
Hi,

I've noticed several people have post that in a non-Western code page
environment, e.g. a Chinese based host, the compiling procedure will runing
with 'warning C4819: The file contains a character that cannot be
represented in the current code page (936). Save the file in Unicode format
to prevent data loss.'
The code page (936) is the Simplified Chinese code page, and the characters
in these files are mostly currency symbols used in Europe, e.g. Euro, Franc.
I met the same warnings, and I can avoid them by making my non-Unicode
setting in Region to English (U.S.), but this is very inconvenient.
So, why cannot the QuantLib project save the source files in Unicode
Encoding?

Sincerely,
Hsiao-nan Cheung
May 19, 2015



--
View this message in context: http://quantlib.10058.n7.nabble.com/About-Code-Page-936-Warnings-and-Unicode-Encoding-tp16574.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: About Code Page (936) Warnings, and UnicodeEncoding.

niheaven
In reply to this post by Luigi Ballabio
Hi Luigi,

Sorry for an empty mail.
I'm trying to make it portable and want to find a way that need not reboot (change a non-Unicode setting need reboot). But I find the easiest way is Unicode-Encoding source files, so why this hadn't achieved?

Yours
Hsiao-nan Cheung
发自我的iPhone


------------------ 原始邮件 ------------------
发件人: Luigi Ballabio <[hidden email]>
发送时间: 2015年05月19日 15:42
收件人: niheaven <[hidden email]>
抄送: QuantLib users <[hidden email]>
主题: Re: [Quantlib-users] About Code Page (936) Warnings, and UnicodeEncoding.

Is there a way to do it portably across compilers and operating systems?

Luigi

On Tue, May 19, 2015 at 4:31 AM, niheaven <[hidden email]> wrote:
Hi,

I've noticed several people have post that in a non-Western code page
environment, e.g. a Chinese based host, the compiling procedure will runing
with 'warning C4819: The file contains a character that cannot be
represented in the current code page (936). Save the file in Unicode format
to prevent data loss.'
The code page (936) is the Simplified Chinese code page, and the characters
in these files are mostly currency symbols used in Europe, e.g. Euro, Franc.
I met the same warnings, and I can avoid them by making my non-Unicode
setting in Region to English (U.S.), but this is very inconvenient.
So, why cannot the QuantLib project save the source files in Unicode
Encoding?

Sincerely,
Hsiao-nan Cheung
May 19, 2015



--
View this message in context: http://quantlib.10058.n7.nabble.com/About-Code-Page-936-Warnings-and-Unicode-Encoding-tp16574.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: About Code Page (936) Warnings, and Unicode Encoding.

Alexander Sokol
In reply to this post by Luigi Ballabio
Luigi, Hsiao-nan:

I believe the best option is UTF-8 (with or without the BOM). This is portable across most modern systems and is also the default in a lot of editors for new files, including C++ files in the Visual Studio. Most editors have the option to save as UTF-8.

Not only this will prevent the compilation errors, but it will also help people specify the properly spelled names in their native alphabet in the copyright page.

No need to convert all files globally, it can just be done for selected files that have non-ascii codes. Because UTF-8 overlaps with ASCII for the initial 127 characters including latin letters, older editors will work correctly for the most part.

Alexander Sokol

P.S. BOM is byte order mark, optional in UTF-8, older editors show it as a symbol in front. It is accepted by C++ compilers and not visible in modern editors.

Reply | Threaded
Open this post in threaded view
|

Re: About Code Page (936) Warnings, and Unicode Encoding.

Peter Caspers-4
Hi,

some experiments with Linux / emacs, gcc, clang and Windows / MSVC
work well with UTF-8 encoded sources containing special characters,
using recent versions of all tools.

Still I would prefer ASCII encoding and no special characters, neither
in comments nor in strings. The benefit is quite limited (well, that's
a matter of taste probably, and my name works well with the ASCII set
already, so who am I to judge ...). The potential for problems is
still existent though because who would know all the platforms, tools,
compilers and output devices and their versions with which QuantLib is
used.

What would be a real good reason for UTF-8 encoding ?

Peter


On 20 May 2015 at 02:45, Alexander Sokol <[hidden email]> wrote:

> Luigi, Hsiao-nan:
>
> I believe the best option is UTF-8 (with or without the BOM). This is
> portable across most modern systems and is also the default in a lot of
> editors for new files, including C++ files in the Visual Studio. Most
> editors have the option to save as UTF-8.
>
> Not only this will prevent the compilation errors, but it will also help
> people specify the properly spelled names in their native alphabet in the
> copyright page.
>
> No need to convert all files globally, it can just be done for selected
> files that have non-ascii codes. Because UTF-8 overlaps with ASCII for the
> initial 127 characters including latin letters, older editors will work
> correctly for the most part.
>
> Alexander Sokol
>
> P.S. BOM is byte order mark, optional in UTF-8, older editors show it as a
> symbol in front. It is accepted by C++ compilers and not visible in modern
> editors.
>
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/About-Code-Page-936-Warnings-and-Unicode-Encoding-tp16574p16580.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users