开发者

how to display registered trademark symbol ® in unix

开发者 https://www.devze.com 2023-02-17 08:39 出处:网络
How to display registered trademark symbol ® unix environment. In this symbol working in window environment, but it not working unix environment.I am having paragraph in java file.displaying this sym

How to display registered trademark symbol ® unix environment. In this symbol working in window environment, but it not working unix environment.I am having paragraph in java file.displaying this symbol when working in windows environment, but move to unix(server) symbol not displaying in the format(®).

String str="stackoverflow ® ";

This is message sending email to customers.When running program in windows sending email correct format.But when running in unix(server) not sending correct format.

What 开发者_如何学Gois problem here ?

When sending email from window system that email displaying correct format.But not unix system.

Example: original message="stackoverflow ®" Getting email message="stackoverflow ÿ"

What is resaon behind in this ?


this sending email message.

I suspect that the problem is in the way that you are constructing and / or sending the mail message; e.g. in the content type / character set that you are specifying. But we can only guess, unless you post the relevant code ...


As @Paŭlo Ebermann suggests, if you are embedding a special character directly in your code, then you can run into compilation problems if the compiler reads your source code using the wrong character set / encoding. You can avoid these problems entirely by using Unicode escapes; e.g. change your code to say:

    String message = "stackoverflow \u00AE";

instead of

    String message = "stackoverflow ®";

IMO, this is a good idea ... even if this is not what is causing your problem.


One possible cause could be the email construction, as Stephen C said.

Another possible cause would be the compilation - the compiler uses the default character set of your system if you don't indicate something else, and this default character set could be different on windows and your unix system.

Look how the source file is encoded, and supply this with the -encoding parameter to the compiler.

Alternatively, to be encoding independent, you could write \u00AE in the source code instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号