Save to html using utf 8Oracle PL/SQL UTL_FILE.PUT bufferinghow to fetch cursor value into varchar2 in pl/sqlHow could i send more than 32,767bytes?UTL_FILE.WRITE_ERROR when calling utl_file.put in a loopWrapping a Stored ProcedureHow to call a function defined in a PL/SQL package with SQLAlchemy?BULK COLLECT into table of objects inside LOOP?Create a package that has three public procedures named proc 1, etcPLW-07204: conversion away from column type may result in sub-optimal query plan how to handle itretrieve os file in oracle apex report

Why is the Digital 0 not 0V in computer systems?

POSIX compatible way to get user name associated with a user ID

Has SHA256 been broken by Treadwell Stanton DuPont?

Is there any reason to concentrate on the Thunderous Smite spell after using its effects?

What is the mathematical notation for rounding a given number to the nearest integer?

Would it be unbalanced to increase Wild Shape uses based on level?

Can I conceal an antihero's insanity - and should I?

Which is the current decimal separator?

Is low emotional intelligence associated with right-wing and prejudiced attitudes?

Why the car dealer is insisting on loan instead of cash

Ambiguity in notation resolved by +

Is "you will become a subject matter expert" code for "you'll be working on your own 100% of the time"?

Are there any “Third Order” acronyms used in space exploration?

What are examples of experiments or studies where pre-registration would not be feasible?

Parallel resistance in electric circuits

Why don't Wizards use wrist straps to protect against disarming charms?

How to be sure services and researches offered by the University are not becoming cases of unfair competition?

If the gambler's fallacy is false, how do notions of "expected number" of events work?

Interaction between Teferi Time Raveler and Enduring Ideal

Does a succubus' charm end when it dies?

Reading double values from a text file

Bit one of the Intel 8080's Flags register

What organs or modifications would be needed for a life biological creature not to require sleep?

sed replacing character in a file



Save to html using utf 8


Oracle PL/SQL UTL_FILE.PUT bufferinghow to fetch cursor value into varchar2 in pl/sqlHow could i send more than 32,767bytes?UTL_FILE.WRITE_ERROR when calling utl_file.put in a loopWrapping a Stored ProcedureHow to call a function defined in a PL/SQL package with SQLAlchemy?BULK COLLECT into table of objects inside LOOP?Create a package that has three public procedures named proc 1, etcPLW-07204: conversion away from column type may result in sub-optimal query plan how to handle itretrieve os file in oracle apex report






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



CREATE OR REPLACE PROCEDURE MY_PROCEDURE
IS

vFil UTL_FILE.FILE_TYPE;
vFilNavn varchar2(250);
vLinje varchar2(32767);

begin
vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
UTL_FILE.PUT_LINE(vFil,vLinje);
end;

FOR recB in (select row from (my_html_content) );

loop
vLinje := recB.Rad;
UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
end loop;

UTL_FILE.FCLOSE(vFil);
UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









share|improve this question






























    0















    I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



    CREATE OR REPLACE PROCEDURE MY_PROCEDURE
    IS

    vFil UTL_FILE.FILE_TYPE;
    vFilNavn varchar2(250);
    vLinje varchar2(32767);

    begin
    vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
    UTL_FILE.PUT_LINE(vFil,vLinje);
    end;

    FOR recB in (select row from (my_html_content) );

    loop
    vLinje := recB.Rad;
    UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
    end loop;

    UTL_FILE.FCLOSE(vFil);
    UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









    share|improve this question


























      0












      0








      0








      I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



      CREATE OR REPLACE PROCEDURE MY_PROCEDURE
      IS

      vFil UTL_FILE.FILE_TYPE;
      vFilNavn varchar2(250);
      vLinje varchar2(32767);

      begin
      vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
      UTL_FILE.PUT_LINE(vFil,vLinje);
      end;

      FOR recB in (select row from (my_html_content) );

      loop
      vLinje := recB.Rad;
      UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
      end loop;

      UTL_FILE.FCLOSE(vFil);
      UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









      share|improve this question














      I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



      CREATE OR REPLACE PROCEDURE MY_PROCEDURE
      IS

      vFil UTL_FILE.FILE_TYPE;
      vFilNavn varchar2(250);
      vLinje varchar2(32767);

      begin
      vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
      UTL_FILE.PUT_LINE(vFil,vLinje);
      end;

      FOR recB in (select row from (my_html_content) );

      loop
      vLinje := recB.Rad;
      UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
      end loop;

      UTL_FILE.FCLOSE(vFil);
      UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);






      oracle plsql utl-file






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 11:08









      Johnny GunnJohnny Gunn

      61 bronze badge




      61 bronze badge

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396070%2fsave-to-html-using-utf-8%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16
















          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16














          1














          1










          1









          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer













          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 13:24









          Wernfried DomscheitWernfried Domscheit

          27k4 gold badges34 silver badges62 bronze badges




          27k4 gold badges34 silver badges62 bronze badges















          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16


















          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16

















          I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

          – Johnny Gunn
          Apr 7 at 16:57






          I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

          – Johnny Gunn
          Apr 7 at 16:57














          Can you make a simple select on the data. Is the output correct?

          – Wernfried Domscheit
          Apr 7 at 17:32





          Can you make a simple select on the data. Is the output correct?

          – Wernfried Domscheit
          Apr 7 at 17:32













          Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

          – Johnny Gunn
          Apr 10 at 8:16






          Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

          – Johnny Gunn
          Apr 10 at 8:16









          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396070%2fsave-to-html-using-utf-8%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript